From patchwork Fri Jan 24 15:16:24 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jochen Baltes X-Patchwork-Id: 1228859 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=lwWMfYS8; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4842mT5tPfz9sP3 for ; Sat, 25 Jan 2020 02:16:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0EE1A88515; Fri, 24 Jan 2020 15:16:37 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UW5AQsiv821e; Fri, 24 Jan 2020 15:16:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 73E3888412; Fri, 24 Jan 2020 15:16:34 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 315F11BF2AB for ; Fri, 24 Jan 2020 15:16:33 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2DE0985FCB for ; Fri, 24 Jan 2020 15:16:33 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6BNTO1kt3iJT for ; Fri, 24 Jan 2020 15:16:32 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 0AFAC85FBA for ; Fri, 24 Jan 2020 15:16:32 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id f129so2046506wmf.2 for ; Fri, 24 Jan 2020 07:16:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VdJI7HZ0rF7/gqXkhjTzlbh8utrqM5mMiJb0ZT20Hko=; b=lwWMfYS8LKlVaVzvq54i6BUTeipiqPCB2OkxVXulyWTWtg5TnfWFrfCPZZJyGp/uL2 sr1Dgz/2vYeldknF/J5uWEdHs8MQTI0OrNTf2v0HACQ+vpAxVfB70TUe082Zu1PHRez1 oN9dUI8W1gdKWNeUYzU0j18xS5qOX2Hstop/mnolwKa3W9v6ILfgblIJTkB3UJgs2P88 A7lieVzZZZTznj50kWM60IIoUBy1PCSW93sU3Qdx2LJ7J8i6DHdMbPw8iRBH9S8sJVNy LwphJaRv5dqI9nJ6YG7mlUM3tT5NtpmlqSdAwbd9FD4d6qmdwHEAQvzYed6Irr7ILUOX i91Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=VdJI7HZ0rF7/gqXkhjTzlbh8utrqM5mMiJb0ZT20Hko=; b=M3asA4N4KMHya/0bRaQ2Pl0dIgLuM7U8TPsE67mazfGSAQPUik5JEmO/1YepxFsYgd 8Mw0Awg0ZluMbzrmhhf/ko9/ikAG4uQTFOuz6ylGiRhraTiHRrRbf0JgJ/thAvJNFJUo x/aBl2A78IwuHJvcPM8D3+IhADbI1tMy+9ly1ABSBla4HYRVcucEHGiwd9Obc/cDUKfT JzpzEw6VaNVqV9SzLVYqBkqsC5t/3D+9TYLXFPk8kslBFmdPS1+ufZppT2Y0EUl9N1J+ Xdlt46txiYj1eaQ3cH8FOteWV3KzgxuryDUqDaZBjyLR9KetfIQuu4171lmM1BciFfvz /Urg== X-Gm-Message-State: APjAAAXo7BYLq9mlPRc0rYNZ0h4o7ZDy965+HpIOd1ishXFSfOm36pKV CfWODZuFIZlKXLWhPFkIgMyOtOEvyIo= X-Google-Smtp-Source: APXvYqxw8tkjCbX7jpzzPcEdktYCq/MYwfiO9dL3kAXahEam4jprwxx+SRs+7qYRgNjc8/xGxw9uwA== X-Received: by 2002:a7b:c622:: with SMTP id p2mr3663928wmk.94.1579878990115; Fri, 24 Jan 2020 07:16:30 -0800 (PST) Received: from ddesab0023.kontron.local ([213.135.10.150]) by smtp.gmail.com with ESMTPSA id z21sm7504390wml.5.2020.01.24.07.16.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Jan 2020 07:16:29 -0800 (PST) From: Jochen Baltes To: buildroot@buildroot.org Date: Fri, 24 Jan 2020 15:16:24 +0000 Message-Id: <20200124151624.16728-1-jochen.baltes@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Buildroot] [PATCH 1/1] package/altera-stapl: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: heiko.thiery@gmail.com, Jochen Baltes Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Alteras Jam STAPL Bytecode Player with 64-bit support. This is a user-space port of the altera-stapl driver from the linux kernel. The source released by Altera wasn't 64-bit compatible. Additionally, the linux version is much cleaner and old cruft was removed. Signed-off-by: Jochen Baltes Tested-by: Heiko Thiery --- DEVELOPERS | 3 ++ package/Config.in | 1 + ...strlcpy-function-with-weak-attribute.patch | 28 +++++++++++++++ ...ix-type-missmatch-warning-in-fprintf.patch | 34 +++++++++++++++++++ package/altera-stapl/Config.in | 8 +++++ package/altera-stapl/altera-stapl.hash | 2 ++ package/altera-stapl/altera-stapl.mk | 21 ++++++++++++ 7 files changed, 97 insertions(+) create mode 100644 package/altera-stapl/0001-declare-strlcpy-function-with-weak-attribute.patch create mode 100644 package/altera-stapl/0002-fix-type-missmatch-warning-in-fprintf.patch create mode 100644 package/altera-stapl/Config.in create mode 100644 package/altera-stapl/altera-stapl.hash create mode 100644 package/altera-stapl/altera-stapl.mk diff --git a/DEVELOPERS b/DEVELOPERS index a1eb052652..f1d443a9cf 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -1237,6 +1237,9 @@ N: Joao Pinto F: board/synopsys/vdk/ F: configs/snps_aarch64_vdk_defconfig +N: Jochen Baltes +F: package/altera-stapl + N: Joel Carlson F: package/c-capnproto/ F: package/capnproto/ diff --git a/package/Config.in b/package/Config.in index 4c94914680..84bf3463ca 100644 --- a/package/Config.in +++ b/package/Config.in @@ -410,6 +410,7 @@ endmenu source "package/acpid/Config.in" source "package/acpitool/Config.in" source "package/aer-inject/Config.in" + source "package/altera-stapl/Config.in" source "package/am335x-pru-package/Config.in" source "package/amd-catalyst/Config.in" source "package/avrdude/Config.in" diff --git a/package/altera-stapl/0001-declare-strlcpy-function-with-weak-attribute.patch b/package/altera-stapl/0001-declare-strlcpy-function-with-weak-attribute.patch new file mode 100644 index 0000000000..63e3a764c8 --- /dev/null +++ b/package/altera-stapl/0001-declare-strlcpy-function-with-weak-attribute.patch @@ -0,0 +1,28 @@ +From c11d4395cc56023edbde179ed770221b1b15b7be Mon Sep 17 00:00:00 2001 +From: Jochen Baltes +Date: Fri, 24 Jan 2020 12:49:28 +0000 +Subject: [PATCH 1/2] declare strlcpy function with weak attribute + +This allow compiling with libc library which has strlcpy already +declared. + +Signed-off-by: Jochen Baltes +--- + altera.c | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/altera.c b/altera.c +index c13225c..116dcc2 100644 +--- a/altera.c ++++ b/altera.c +@@ -216,6 +216,7 @@ static inline void put_unaligned_le32(uint32_t val, uint8_t *p) + *p++ = val >> 24; + } + ++__attribute__ ((weak)) + size_t strlcpy(char *dest, const char *src, size_t size) + { + size_t ret = strlen(src); +-- +2.20.1 + diff --git a/package/altera-stapl/0002-fix-type-missmatch-warning-in-fprintf.patch b/package/altera-stapl/0002-fix-type-missmatch-warning-in-fprintf.patch new file mode 100644 index 0000000000..ffe3e89daf --- /dev/null +++ b/package/altera-stapl/0002-fix-type-missmatch-warning-in-fprintf.patch @@ -0,0 +1,34 @@ +From 09afe2b487df327e13b2d8c08f84e8428df76b8f Mon Sep 17 00:00:00 2001 +From: Jochen Baltes +Date: Fri, 24 Jan 2020 12:44:54 +0000 +Subject: [PATCH 2/2] fix type missmatch warning in fprintf + +Signed-off-by: Jochen Baltes +--- + altera.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/altera.c b/altera.c +index 116dcc2..ac47e01 100644 +--- a/altera.c ++++ b/altera.c +@@ -23,6 +23,7 @@ + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + ++#include + #include + #include + #include +@@ -445,7 +446,7 @@ int altera_execute(uint8_t *p, int32_t program_size, char *action, + ? get_unaligned_be16(&p[offset + 1]) + : get_unaligned_be32(&p[offset + 1]); + name = &p[str_table + name_id]; +- fprintf(stderr, "Variable #%d (%s) attrs=%x value=%08lx var_size=%d orig_value=%08x\n", ++ fprintf(stderr, "Variable #%d (%s) attrs=%x value=%" PRIxPTR " var_size=%d orig_value=%08x\n", + i, name, attrs[i], vars[i], var_size[i], value); + } + } +-- +2.20.1 + diff --git a/package/altera-stapl/Config.in b/package/altera-stapl/Config.in new file mode 100644 index 0000000000..ff7d23f841 --- /dev/null +++ b/package/altera-stapl/Config.in @@ -0,0 +1,8 @@ +config BR2_PACKAGE_ALTERA_STAPL + bool "altera-stapl" + depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_4_8 # libgpiod + select BR2_PACKAGE_LIBGPIOD + help + Altera Jam STAPL Bytecode Player. + + https://github.com/kontron/altera-stapl diff --git a/package/altera-stapl/altera-stapl.hash b/package/altera-stapl/altera-stapl.hash new file mode 100644 index 0000000000..9ea977924e --- /dev/null +++ b/package/altera-stapl/altera-stapl.hash @@ -0,0 +1,2 @@ +sha256 22c7c9dadfb0d09a6fd3b5497cc22f7ebf7a0969d20dc37e71c8035bb5642036 altera-stapl-0.3.2.tar.gz +sha256 d8c320ffc0030d1b096ae4732b50d2b811cf95e9a9b7377c1127b2563e0a0388 COPYING diff --git a/package/altera-stapl/altera-stapl.mk b/package/altera-stapl/altera-stapl.mk new file mode 100644 index 0000000000..149a243604 --- /dev/null +++ b/package/altera-stapl/altera-stapl.mk @@ -0,0 +1,21 @@ +################################################################################ +# +# altera-stapl +# +################################################################################ + +ALTERA_STAPL_VERSION = 0.3.2 +ALTERA_STAPL_SITE = $(call github,kontron,altera-stapl,$(ALTERA_STAPL_VERSION)) +ALTERA_STAPL_LICENSE = GPLv2+ +ALTERA_STAPL_LICENSE_FILES = COPYING +ALTERA_STAPL_DEPENDENCIES = libgpiod + +define ALTERA_STAPL_BUILD_CMDS + $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) all +endef + +define ALTERA_STAPL_INSTALL_TARGET_CMDS + $(MAKE) $(TARGET_CONFIGURE_OPTS) -C $(@D) DESTDIR=$(TARGET_DIR) install +endef + +$(eval $(generic-package))