From patchwork Mon Aug 8 03:57:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1664404 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=uZUY1D7T; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ventanamicro.com header.i=@ventanamicro.com header.a=rsa-sha256 header.s=google header.b=Wtxxgd+n; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4M1MrC0wgRz9s2R for ; Mon, 8 Aug 2022 13:58:35 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4KCva7Vv8MEErQhBZ7n8J5ihBosbFUOUS4XoSPkrMwo=; b=uZUY1D7TvPYb6X vUuMdr/saZuwWMEnKuU7Lwsyrqh3iS/BUHLIJSUoGW6QsYnffUcfOVdr5k+QTeqLFyfjjoKvxWTFm uqXf4wHmD/RLUM0OooZ3lbLNqeCu2D0dDWmaDH1Ws/ukramxUMVOgOjhaNOhMz375+iwFpG/T0Fnc jyEaO2z+OfZKyBoaLF8Dy072uBzV9Lb9znjQaK6LcuRxHS8ERNoWwI1m7QMgFBHzwv+qoYSdYB46P VvJx/maBWXC/OZirimJ/xcQl0KfceeO9SbEG0tHKnR72A5v2MH4XKGuuzgky1n0QSRBvwTkClI4TO 0iuxKWlccYuDSGwwdtmw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKtuI-008wEq-97; Mon, 08 Aug 2022 03:58:22 +0000 Received: from mail-oi1-x22d.google.com ([2607:f8b0:4864:20::22d]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oKtuF-008wBN-R0 for opensbi@lists.infradead.org; Mon, 08 Aug 2022 03:58:21 +0000 Received: by mail-oi1-x22d.google.com with SMTP id u14so1013648oie.2 for ; Sun, 07 Aug 2022 20:58:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=YFuyO7EK0jGHPNnjxRSWA0V+werUhlPblzYrxYSRy7w=; b=Wtxxgd+nYt9RokuZHgGTr+ixLQH1ZcH5tGn+9tMzb6fabr4vv8JMHPERfjpB1n7+fA h3Yq0GQzoChzP54jlByRpGCmGM8RkxHRNR/0FquzCorzmGsoEqEzquSG0lBoTWDggWBV k6WNWBcNWvAiCqCGe2pc5Z1kP9co5b4+hRm7iJuSBpOkapovSR/8uC7eww9aZ/VWFR0O FaXlvuRCq1GlU2/6nPvivxeFmEP5yx+5r8fEfF+NJ74EWMvmLdQzP24fs/jl7i0vpTfv 85KiFia38Td8vWtUANMfnJuMlZKm6CpOLthb0na1Dx0095exx75vxf9EuWCR9mz7qj0d 0oLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=YFuyO7EK0jGHPNnjxRSWA0V+werUhlPblzYrxYSRy7w=; b=EPr1sXvNFRRKGQd04kdSMHVUcaKqto3TsLcuU/6obUUko4H2fnqJdWaYXpKAc7ukbu 1ANs0pTEfW6wX9FpLtsCzPsmtYgA7kwR3/mp5ob2wxC3wModfk38fzwUaAsiAW/apLte tZFWW5+E60kwLoHmRGVhMNjWPMLU5sgj8FpCkMIF2KjMcvbGnDx7IMwpXHFmvDTOQhjo owKQl28hqIJTNe3VtUI4zC7lNjNcfXBTvXUoisadsKvtoUohscSjRixInVyKAD0egGJ+ HtKUoHT/YgV5MnPqlx7541teZy6xoVIvuh1DMjEWXZNzle8yyz6mKFT8j84IcVCMOWHd 8zMw== X-Gm-Message-State: ACgBeo2+bVZlMN0pb1gg9IhtfmaTHjn/s0Hh+eWZvp0/+siajTmHFPLs hcjboTU0QNmHRUU6Yd4YxmAlGQ== X-Google-Smtp-Source: AA6agR65eVp4iYQS2qYxlDfNmeKMAqXcA8ZlDk9e7AbWRLzj8FXgyVM8mcHbfXn3pb5zPUyaafiCag== X-Received: by 2002:a05:6808:1644:b0:2ef:b05:1cdc with SMTP id az4-20020a056808164400b002ef0b051cdcmr7186721oib.66.1659931098438; Sun, 07 Aug 2022 20:58:18 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([103.97.165.210]) by smtp.gmail.com with ESMTPSA id r2-20020a9d30c2000000b0061dc5648bf6sm2008382otg.6.2022.08.07.20.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Aug 2022 20:58:17 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Andrew Jones , David Abdurachmanov , Heinrich Schuchardt , Andreas Schwab , Mark Kettenis , Emmanuel Vadot , Anup Patel , opensbi@lists.infradead.org, Anup Patel , Atish Patra Subject: [PATCH v8 04/17] lib: utils/serial: Use kconfig for enabling/disabling drivers Date: Mon, 8 Aug 2022 09:27:27 +0530 Message-Id: <20220808035740.69335-5-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220808035740.69335-1-apatel@ventanamicro.com> References: <20220808035740.69335-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220807_205819_898013_B216DE33 X-CRM114-Status: GOOD ( 13.13 ) X-Spam-Score: -0.2 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: We update serial drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate serial drivers for each platform. Signed-off-by: Anup Patel Tested-by: Andrew Jones Acked-by: Atish Patra Tested-by: Atish Patra --- inclu [...] Content analysis details: (-0.2 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:22d listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: opensbi@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "opensbi" Errors-To: opensbi-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org We update serial drivers makefile to use kconfig for enabling/disabling drivers. To avoid compile errors, we also enable appropriate serial drivers for each platform. Signed-off-by: Anup Patel Tested-by: Andrew Jones Acked-by: Atish Patra Tested-by: Atish Patra --- include/sbi_utils/serial/fdt_serial.h | 8 +++ lib/utils/Kconfig | 6 +++ lib/utils/serial/Kconfig | 71 +++++++++++++++++++++++++++ lib/utils/serial/objects.mk | 44 ++++++++--------- platform/andes/ae350/Kconfig | 1 + platform/fpga/ariane/Kconfig | 1 + platform/fpga/openpiton/Kconfig | 1 + platform/generic/configs/defconfig | 8 +++ platform/kendryte/k210/Kconfig | 1 + platform/nuclei/ux600/Kconfig | 1 + platform/template/Kconfig | 1 + 11 files changed, 121 insertions(+), 22 deletions(-) create mode 100644 lib/utils/serial/Kconfig diff --git a/include/sbi_utils/serial/fdt_serial.h b/include/sbi_utils/serial/fdt_serial.h index 6451c23..daa2e4f 100644 --- a/include/sbi_utils/serial/fdt_serial.h +++ b/include/sbi_utils/serial/fdt_serial.h @@ -12,6 +12,8 @@ #include +#ifdef CONFIG_FDT_SERIAL + struct fdt_serial { const struct fdt_match *match_table; int (*init)(void *fdt, int nodeoff, const struct fdt_match *match); @@ -19,4 +21,10 @@ struct fdt_serial { int fdt_serial_init(void); +#else + +static inline int fdt_serial_init(void) { return 0; } + +#endif + #endif diff --git a/lib/utils/Kconfig b/lib/utils/Kconfig index d6e0506..4524a3f 100644 --- a/lib/utils/Kconfig +++ b/lib/utils/Kconfig @@ -1 +1,7 @@ # SPDX-License-Identifier: BSD-2-Clause + +menu "Utils and Drivers Support" + +source "$(OPENSBI_SRC_DIR)/lib/utils/serial/Kconfig" + +endmenu diff --git a/lib/utils/serial/Kconfig b/lib/utils/serial/Kconfig new file mode 100644 index 0000000..e114f26 --- /dev/null +++ b/lib/utils/serial/Kconfig @@ -0,0 +1,71 @@ +# SPDX-License-Identifier: BSD-2-Clause + +menu "Serial Device Support" + +config FDT_SERIAL + bool "FDT based serial drivers" + default n + +if FDT_SERIAL + +config FDT_SERIAL_GAISLER + bool "Gaisler UART FDT driver" + select SERIAL_GAISLER + default n + +config FDT_SERIAL_HTIF + bool "Host transfer interface (HTIF) UART FDT driver" + default n + +config FDT_SERIAL_SHAKTI + bool "Shakti UART FDT driver" + select SERIAL_SHAKTI + default n + +config FDT_SERIAL_SIFIVE + bool "SiFive UART FDT driver" + select SERIAL_SIFIVE + default n + +config FDT_SERIAL_LITEX + bool "LiteX UART FDT driver" + select SERIAL_LITEX + default n + +config FDT_SERIAL_UART8250 + bool "8250 UART FDT driver" + select SERIAL_UART8250 + default n + +config FDT_SERIAL_XILINX_UARTLITE + bool "Xilinx UART Lite FDT driver" + select SERIAL_XILINX_UARTLITE + default n + +endif + +config SERIAL_GAISLER + bool "Gaisler UART support" + default n + +config SERIAL_SHAKTI + bool "Shakti UART support" + default n + +config SERIAL_SIFIVE + bool "SiFive UART support" + default n + +config SERIAL_LITEX + bool "LiteX UART support" + default n + +config SERIAL_UART8250 + bool "8250 UART support" + default n + +config SERIAL_XILINX_UARTLITE + bool "Xilinx UART Lite support" + default n + +endmenu diff --git a/lib/utils/serial/objects.mk b/lib/utils/serial/objects.mk index d26a74e..fa9f5a3 100644 --- a/lib/utils/serial/objects.mk +++ b/lib/utils/serial/objects.mk @@ -7,33 +7,33 @@ # Anup Patel # -libsbiutils-objs-y += serial/fdt_serial.o -libsbiutils-objs-y += serial/fdt_serial_drivers.o +libsbiutils-objs-$(CONFIG_FDT_SERIAL) += serial/fdt_serial.o +libsbiutils-objs-$(CONFIG_FDT_SERIAL) += serial/fdt_serial_drivers.o -carray-fdt_serial_drivers-y += fdt_serial_gaisler -libsbiutils-objs-y += serial/fdt_serial_gaisler.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_GAISLER) += fdt_serial_gaisler +libsbiutils-objs-$(CONFIG_FDT_SERIAL_GAISLER) += serial/fdt_serial_gaisler.o -carray-fdt_serial_drivers-y += fdt_serial_htif -libsbiutils-objs-y += serial/fdt_serial_htif.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_HTIF) += fdt_serial_htif +libsbiutils-objs-$(CONFIG_FDT_SERIAL_HTIF) += serial/fdt_serial_htif.o -carray-fdt_serial_drivers-y += fdt_serial_shakti -libsbiutils-objs-y += serial/fdt_serial_shakti.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_SHAKTI) += fdt_serial_shakti +libsbiutils-objs-$(CONFIG_FDT_SERIAL_SHAKTI) += serial/fdt_serial_shakti.o -carray-fdt_serial_drivers-y += fdt_serial_sifive -libsbiutils-objs-y += serial/fdt_serial_sifive.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_SIFIVE) += fdt_serial_sifive +libsbiutils-objs-$(CONFIG_FDT_SERIAL_SIFIVE) += serial/fdt_serial_sifive.o -carray-fdt_serial_drivers-y += fdt_serial_litex -libsbiutils-objs-y += serial/fdt_serial_litex.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_LITEX) += fdt_serial_litex +libsbiutils-objs-$(CONFIG_FDT_SERIAL_LITEX) += serial/fdt_serial_litex.o -carray-fdt_serial_drivers-y += fdt_serial_uart8250 -libsbiutils-objs-y += serial/fdt_serial_uart8250.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_UART8250) += fdt_serial_uart8250 +libsbiutils-objs-$(CONFIG_FDT_SERIAL_UART8250) += serial/fdt_serial_uart8250.o -carray-fdt_serial_drivers-y += fdt_serial_xlnx_uartlite -libsbiutils-objs-y += serial/fdt_serial_xlnx_uartlite.o +carray-fdt_serial_drivers-$(CONFIG_FDT_SERIAL_XILINX_UARTLITE) += fdt_serial_xlnx_uartlite +libsbiutils-objs-$(CONFIG_FDT_SERIAL_XILINX_UARTLITE) += serial/fdt_serial_xlnx_uartlite.o -libsbiutils-objs-y += serial/gaisler-uart.o -libsbiutils-objs-y += serial/shakti-uart.o -libsbiutils-objs-y += serial/sifive-uart.o -libsbiutils-objs-y += serial/litex-uart.o -libsbiutils-objs-y += serial/uart8250.o -libsbiutils-objs-y += serial/xlnx-uartlite.o +libsbiutils-objs-$(CONFIG_SERIAL_GAISLER) += serial/gaisler-uart.o +libsbiutils-objs-$(CONFIG_SERIAL_SHAKTI) += serial/shakti-uart.o +libsbiutils-objs-$(CONFIG_SERIAL_SIFIVE) += serial/sifive-uart.o +libsbiutils-objs-$(CONFIG_SERIAL_LITEX) += serial/litex-uart.o +libsbiutils-objs-$(CONFIG_SERIAL_UART8250) += serial/uart8250.o +libsbiutils-objs-$(CONFIG_SERIAL_XILINX_UARTLITE) += serial/xlnx-uartlite.o diff --git a/platform/andes/ae350/Kconfig b/platform/andes/ae350/Kconfig index 4b73c76..162d19c 100644 --- a/platform/andes/ae350/Kconfig +++ b/platform/andes/ae350/Kconfig @@ -2,4 +2,5 @@ config PLATFORM_ANDES_AE350 bool + select SERIAL_UART8250 default y diff --git a/platform/fpga/ariane/Kconfig b/platform/fpga/ariane/Kconfig index 70d2004..3ce0ec1 100644 --- a/platform/fpga/ariane/Kconfig +++ b/platform/fpga/ariane/Kconfig @@ -2,4 +2,5 @@ config PLATFORM_ARIANE_FPGA bool + select SERIAL_UART8250 default y diff --git a/platform/fpga/openpiton/Kconfig b/platform/fpga/openpiton/Kconfig index 81e4b76..4dd752d 100644 --- a/platform/fpga/openpiton/Kconfig +++ b/platform/fpga/openpiton/Kconfig @@ -2,4 +2,5 @@ config PLATFORM_OPENPITON_FPGA bool + select SERIAL_UART8250 default y diff --git a/platform/generic/configs/defconfig b/platform/generic/configs/defconfig index e69de29..ce70c59 100644 --- a/platform/generic/configs/defconfig +++ b/platform/generic/configs/defconfig @@ -0,0 +1,8 @@ +CONFIG_FDT_SERIAL=y +CONFIG_FDT_SERIAL_GAISLER=y +CONFIG_FDT_SERIAL_HTIF=y +CONFIG_FDT_SERIAL_SHAKTI=y +CONFIG_FDT_SERIAL_SIFIVE=y +CONFIG_FDT_SERIAL_LITEX=y +CONFIG_FDT_SERIAL_UART8250=y +CONFIG_FDT_SERIAL_XILINX_UARTLITE=y diff --git a/platform/kendryte/k210/Kconfig b/platform/kendryte/k210/Kconfig index 889f16b..adc7613 100644 --- a/platform/kendryte/k210/Kconfig +++ b/platform/kendryte/k210/Kconfig @@ -2,4 +2,5 @@ config PLATFORM_KENDRYTE_K210 bool + select SERIAL_SIFIVE default y diff --git a/platform/nuclei/ux600/Kconfig b/platform/nuclei/ux600/Kconfig index c368ef4..69fe8f8 100644 --- a/platform/nuclei/ux600/Kconfig +++ b/platform/nuclei/ux600/Kconfig @@ -2,4 +2,5 @@ config PLATFORM_NUCLEI_UX600 bool + select SERIAL_SIFIVE default y diff --git a/platform/template/Kconfig b/platform/template/Kconfig index 6fbb567..f080729 100644 --- a/platform/template/Kconfig +++ b/platform/template/Kconfig @@ -9,4 +9,5 @@ # config PLATFORM_TEMPLATE bool + select SERIAL_UART8250 default y