From patchwork Tue May 3 03:37:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anup Patel X-Patchwork-Id: 1625305 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=TsTGfZKP; 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=NsBbju//; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::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:e::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 4Kslzx4ww3z9sFr for ; Tue, 3 May 2022 13:38:37 +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: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:In-Reply-To:References: List-Owner; bh=hTXMWvHo2efq/IoLKHwppqOLQMLf2Ae2Cfrr4sA0b9c=; b=TsTGfZKPIJGKKQ G7FEKpDRH+ph8/CkG0cQpz2OQHy6c5swu1jV2JSUkvufHRdktZHzKV8h+GMemmoRUChvXrTBboTio O4yhDDJlR40ry9QLv8NItv49thPlLZiflG0cDfKHeHxA+QVe0sXejsjKbbT+gM6wKfcFcbec8VD3B vdsv3t1kdTJFND87WosgxAOMYqMXOFRWMTu9hmhv4WO4qFHoxl1KTIzS2I0ry/4C4UDLu0iJQ2YQu si9+6WGYLNO6bshg0Akkb3tjS7C8e5QQ3NyzKZf2jMglklZimgH2P2IMcFCJ8gVvz/XMENAYBDrvp oiqfqkcy/zeu2689Ttgw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nljMh-003Znx-77; Tue, 03 May 2022 03:38:19 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nljMf-003ZnG-2l for opensbi@lists.infradead.org; Tue, 03 May 2022 03:38:18 +0000 Received: by mail-pl1-x630.google.com with SMTP id n18so13998227plg.5 for ; Mon, 02 May 2022 20:38:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JQu17sc8wG3qyjfjGmB5zL2w3469gew75aeMmprFxnw=; b=NsBbju//HuTaryKh7W4wOSXofAZ8bDQcHoZYt4plLk51GcbBa63bGPfRu8r0C8OKtR /W8BjpwTMC1CAm07pDzIL8LIi1EMqXowaGdo43TJHPfLZTGPgS6BQroz5Bl1NkDnnDah HrAQAd+w0MTBQsXIWDP46vqD1ltfUvN5DdyzDmlbfiVPuFphZmAemFuZ603FvOvY110l 8TJA3lMFoibifG1cJoKrHn3gR9f/o7Cch2xGWmj079P0WLXImecJ70NLIf7IEp6ElvdI jtpkiKlpvvM8srplJRq0dqV83baOiE89psOFBed6tihz2KzphDNwbKxw/D0DJfMosh6x 3etg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=JQu17sc8wG3qyjfjGmB5zL2w3469gew75aeMmprFxnw=; b=0HjX30Jrfc+V0LOocDGN4okBM8TYjaXFo4RU7jFjp5C7WG9A/auAlAZQt870heC+E7 H97mzCwFgWYOUPJlx0Udl+V+TRHvo+oUxn+BhwTVReZTR9Ll+2epdBxvW/QzSvscFxES tjiLR7x+oMZqXE1kf66yTYkpEuKVKovrIHOiVTDX5Ggnhigw+8g7OG10rV0XnvYyRCtN QN6nfz6+Tm/yptVRzxIgcJBF0sQ+uD9DeSJWEyhrxMI0a3jbyMxUPux2WCaa7BUzyuD4 TjgTcb0AdRvTwcpQcWwhDqenDVWK7VWtRgZZhUhAoHlU7EL6n6tZgvIHiUheD0EbyvnH TAEQ== X-Gm-Message-State: AOAM53235TqwEzHIZwlfEuw+5y0WnHiAr5zWLVJ0oLOkymamL4BK6C51 +Ozb8bVB40U+v9wdR1PUPZz1og== X-Google-Smtp-Source: ABdhPJyuVqyuah0LjZw9NmIAnO48CFfXhMFl8w8zUVBmW/QVk3ydeC7t8DYecSpBfRMNQbQy/7VftA== X-Received: by 2002:a17:902:a406:b0:158:260d:1ed2 with SMTP id p6-20020a170902a40600b00158260d1ed2mr14861050plq.49.1651549093725; Mon, 02 May 2022 20:38:13 -0700 (PDT) Received: from anup-ubuntu64-vm.. ([122.171.53.184]) by smtp.gmail.com with ESMTPSA id h7-20020a170902ac8700b0015e8d4eb273sm5380909plr.189.2022.05.02.20.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 20:38:12 -0700 (PDT) From: Anup Patel To: Atish Patra , Alistair Francis Cc: Anup Patel , opensbi@lists.infradead.org, Anup Patel Subject: [PATCH 00/11] OpenSBI compile-time C arrays Date: Tue, 3 May 2022 09:07:48 +0530 Message-Id: <20220503033759.544156-1-apatel@ventanamicro.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220502_203817_188281_9D5ACC53 X-CRM114-Status: GOOD ( 11.15 ) 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: This series aims at removing hard-coded C arrays for drivers and modules in OpenSBI sources and replace it with dynamically generated arrays at compile-time. External firmwares which use OpenSBI as li [...] 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:630 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 This series aims at removing hard-coded C arrays for drivers and modules in OpenSBI sources and replace it with dynamically generated arrays at compile-time. External firmwares which use OpenSBI as library will have to create these arrays separately because they typically don't use OpenSBI build system. These patches can also be found in generated_carray_v1 branch at: https://github.com/avpatel/opensbi.git Anup Patel (11): Makefile: Allow generated C source to be anywhere in build directory Makefile: Add support for generating C array at compile time lib: utils/reset: Generate FDT reset driver list at compile-time lib: utils/serial: Generate FDT serial driver list at compile-time lib: utils/timer: Generate FDT timer driver list at compile-time lib: utils/irqchip: Generate FDT irqchip driver list at compile-time lib: utils/ipi: Generate FDT ipi driver list at compile-time lib: utils/i2c: Generate FDT i2c adapter driver list at compile-time lib: utils/gpio: Generate FDT gpio driver list at compile-time platform: generic: Generate platform override module list at compile-time platform: generic: Move Sifive platform overrides into own directory Makefile | 17 +++- include/sbi_utils/gpio/fdt_gpio.h | 2 + lib/utils/gpio/fdt_gpio.c | 18 ++--- lib/utils/gpio/fdt_gpio_drivers.carray | 3 + lib/utils/gpio/objects.mk | 4 + lib/utils/i2c/fdt_i2c.c | 14 ++-- lib/utils/i2c/fdt_i2c_adapter_drivers.carray | 3 + lib/utils/i2c/objects.mk | 4 + lib/utils/ipi/fdt_ipi.c | 12 ++- lib/utils/ipi/fdt_ipi_drivers.carray | 3 + lib/utils/ipi/objects.mk | 4 + lib/utils/irqchip/fdt_irqchip.c | 16 ++-- lib/utils/irqchip/fdt_irqchip_drivers.carray | 3 + lib/utils/irqchip/objects.mk | 8 ++ lib/utils/reset/fdt_reset.c | 22 ++---- lib/utils/reset/fdt_reset_drivers.carray | 3 + lib/utils/reset/objects.mk | 12 +++ lib/utils/serial/fdt_serial.c | 28 ++----- lib/utils/serial/fdt_serial_drivers.carray | 3 + lib/utils/serial/objects.mk | 16 ++++ lib/utils/timer/fdt_timer.c | 12 ++- lib/utils/timer/fdt_timer_drivers.carray | 3 + lib/utils/timer/objects.mk | 4 + platform/generic/objects.mk | 3 +- platform/generic/platform.c | 14 ++-- .../generic/platform_override_modules.carray | 3 + .../{sifive_fu540.c => sifive/fu540.c} | 0 .../{sifive_fu740.c => sifive/fu740.c} | 0 platform/generic/sifive/objects.mk | 9 +++ scripts/carray.sh | 77 +++++++++++++++++++ 30 files changed, 224 insertions(+), 96 deletions(-) create mode 100644 lib/utils/gpio/fdt_gpio_drivers.carray create mode 100644 lib/utils/i2c/fdt_i2c_adapter_drivers.carray create mode 100644 lib/utils/ipi/fdt_ipi_drivers.carray create mode 100644 lib/utils/irqchip/fdt_irqchip_drivers.carray create mode 100644 lib/utils/reset/fdt_reset_drivers.carray create mode 100644 lib/utils/serial/fdt_serial_drivers.carray create mode 100644 lib/utils/timer/fdt_timer_drivers.carray create mode 100644 platform/generic/platform_override_modules.carray rename platform/generic/{sifive_fu540.c => sifive/fu540.c} (100%) rename platform/generic/{sifive_fu740.c => sifive/fu740.c} (100%) create mode 100644 platform/generic/sifive/objects.mk create mode 100755 scripts/carray.sh Reviewed-by: Atish Patra