Skip to contentSkip to conversation

ti-test: Add mcrc64 test application

PATCH Superseded Aniket Limaye 5 participants 7 messages Feb 4, 2025 – Feb 6, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 ti-test: Add mcrc64 test application

From: Udit Kumar <[email protected]>

Add mcrc64 test application recipe.
This application is documented at[0].

[0]: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j722s/10_01_00_04/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/MCRC64.html

---
v3:
* Ryan:
- Maintain aplhabetical ordering of ti-test packages

v2:
* Denys:
- Add required SUMMARY variable as per https://docs.yoctoproject.org/next/contributor-guide/recipe-style-guide.html#required-variables

---
 .../recipes-core/packagegroups/ti-test.bb     |   1 +
 .../recipes-kernel/mcrc64/files/mcrc64.c      | 114 ++++++++++++++++++
 .../recipes-kernel/mcrc64/mcrc64.bb           |  18 +++
 3 files changed, 133 insertions(+)
 create mode 100644 meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c
 create mode 100644 meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb
meta-arago-test/recipes-core/packagegroups/ti-test.bb +1 -0
index 814e3ea6..857e06fb 100644
@@ -31,6 +31,7 @@ TI_TEST_BASE = "\
     linuxptp \
     lmbench \
     lsof \
+    mcrc64 \
     media-ctl \
     memtester \
     mstpd \
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +114 -0

114 lines not on this page · raw message

meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +18 -0
new file mode 100644
index 00000000..a707430d
@@ -0,0 +1,18 @@
+SUMMARY = "Application to test MCRC64 driver"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://mcrc64.c;beginline=1;endline=33;md5=070547e79367134fcfdf7fdb5e3ef7e3"
+
+SRC_URI = "file://mcrc64.c"
+
+S = "${WORKDIR}/sources"
+UNPACKDIR = "${S}"
+
+do_compile() {
+	${CC} ${CFLAGS} ${LDFLAGS} ${UNPACKDIR}/mcrc64.c -o mcrc64
+}
+
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 mcrc64 ${D}${bindir}
+}
Signature · 1 line
2.48.1
#1 lore raw
Quoted 4 lines · Aniket Limaye via lists.yoctoproject.org

From: Udit Kumar <[email protected]>

Add mcrc64 test application recipe.
This application is documented at[0].

Why?

Also the source shouldn't be here in the yocto recipe, how do you expect the other distros we offer to make use of this?

Put it on github, or if it specifically testing some kernel interface then maybe in the kernel source under tools/testing/crypto/ with the other crypto userspace tests.

Andrew

Quoted 177 lines

[0]: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j722s/10_01_00_04/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/MCRC64.html

---
v3:
* Ryan:
- Maintain aplhabetical ordering of ti-test packages

v2:
* Denys:
- Add required SUMMARY variable as per https://docs.yoctoproject.org/next/contributor-guide/recipe-style-guide.html#required-variables

---
  .../recipes-core/packagegroups/ti-test.bb     |   1 +
  .../recipes-kernel/mcrc64/files/mcrc64.c      | 114 ++++++++++++++++++
  .../recipes-kernel/mcrc64/mcrc64.bb           |  18 +++
  3 files changed, 133 insertions(+)

create mode 100644 meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c create mode 100644 meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb

meta-arago-test/recipes-core/packagegroups/ti-test.bb +1 -0
index 814e3ea6..857e06fb 100644
@@ -31,6 +31,7 @@ TI_TEST_BASE = "\
      linuxptp \
      lmbench \
      lsof \
+    mcrc64 \
      media-ctl \
      memtester \
      mstpd \
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +114 -0
new file mode 100644
index 00000000..fc7a75d6
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2025 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <linux/if_alg.h>
+#include <string.h>
+
+#define BUFFER_SIZE 4096
+#define SECTOR 4096
+
+int main (int argc, char **argv) {
+
+    int desc[2] = { -1, -1 };
+
+    struct sockaddr_alg sock = {
+        .salg_family = AF_ALG,
+        .salg_type   = "hash",
+        .salg_name   = "crc64-iso3309"
+    };
+
+    if ((desc[0] = socket(AF_ALG, SOCK_SEQPACKET, 0)) == -1 ) {
+        perror("socket");
+        return -1;
+    }
+
+    if( bind(desc[0], (struct sockaddr *) &sock, sizeof(sock)) != 0 ) {
+        perror("bind");
+        return -1;
+    }
+
+    if( (desc[1] = accept(desc[0], NULL, 0)) == -1 )
+        return -1;
+
+    if (argc != 2 || strlen(argv[1]) == 0) {
+        printf("Please specify filename\n");
+        return -1; // empty string
+    }
+
+    FILE* file;
+    unsigned char *buffer;
+    if(posix_memalign((void *)&buffer, SECTOR, BUFFER_SIZE)) {
+        perror("posix_memalign failed");
+        return -1;
+    }
+
+    file = fopen(argv[1], "rb");
+    if(file == NULL)
+    {
+        printf("An error occured while opening file: %s\n", argv[1]);
+        free(buffer);
+        return -1;
+    }
+
+    while(!feof(file))
+    {
+        unsigned int count = fread(buffer, sizeof(char), BUFFER_SIZE, file);
+        if(ferror(file))
+        {
+            printf("An error occurred while accessing the file: %s\n", argv[1]);
+            fclose(file);
+            free(buffer);
+            return -1;
+        }
+
+        if (send(desc[1], buffer, count, MSG_MORE) != count) {
+            free(buffer);
+            return -1;
+        }
+    }
+
+    long int crc64 = 0x0000000000000000;
+    if(read(desc[1], &crc64, 8) != 8) {
+        free(buffer);
+        return -1;
+    }
+
+    printf("0x%llx\n", crc64);
+    free(buffer);
+    return 0;
+}
meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +18 -0
new file mode 100644
index 00000000..a707430d
@@ -0,0 +1,18 @@
+SUMMARY = "Application to test MCRC64 driver"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://mcrc64.c;beginline=1;endline=33;md5=070547e79367134fcfdf7fdb5e3ef7e3"
+
+SRC_URI = "file://mcrc64.c"
+
+S = "${WORKDIR}/sources"
+UNPACKDIR = "${S}"
+
+do_compile() {
+	${CC} ${CFLAGS} ${LDFLAGS} ${UNPACKDIR}/mcrc64.c -o mcrc64
+}
+
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 mcrc64 ${D}${bindir}
+}
#2 lore raw
Quoted 13 lines · Andrew Davis via lists.yoctoproject.org
Quoted 1 line · Aniket Limaye via lists. yoctoproject. org

From: Udit Kumar <u-kumar1@ ti. com> > > Add mcrc64 test application

recipe. > This application is documented at[0]. Why? Also the source shouldn't be here ZjQcmQRYFpfptBannerStart
This message was sent from outside of Texas Instruments.
Do not click links or open attachments unless you recognize the source of this email and know the content is safe. Report Suspicious
<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!uRdqV30l1mwbIKXEnDNjH0oo99olCbsPqm549YsQxoVJEzrvd9guIUd37GXbtnlWpwdZCGrcEUvq4uINTkJrifT6tlU$>

ZjQcmQRYFpfptBannerEnd

Quoted 2 lines · Aniket Limaye via lists.yoctoproject.org

From: Udit Kumar <[email protected]>

Quoted 7 lines
Quoted 2 lines

Add mcrc64 test application recipe.
This application is documented at[0].

Why?

Also the source shouldn't be here in the yocto recipe, how do you expect the other distros we offer to make use of this?

+1 on Andrew's point

We already had a discussion on the above point with hwspinlocktest in past [1] which was reworked to go via GitHub way [2]

Let's not use meta-arago to be a placeholder for example applications

[1]: https://lists.yoctoproject.org/g/meta-arago/message/15577

[2]: https://lists.yoctoproject.org/g/meta-arago/message/15630

--
Chirag

Quoted 195 lines

Put it on github, or if it specifically testing some kernel interface then maybe in the kernel source under tools/testing/crypto/ with the other crypto userspace tests.

Andrew

Quoted 167 lines

[0]: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j722s/10_01_00_04/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/MCRC64.html

---
v3:
* Ryan:
- Maintain aplhabetical ordering of ti-test packages

v2:
* Denys:
- Add required SUMMARY variable as per https://urldefense.com/v3/__https://docs.yoctoproject.org/next/contributor-guide/recipe-style-guide.html*required-variables__;Iw!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMDFqsJ3A$

---
  .../recipes-core/packagegroups/ti-test.bb     |   1 +
  .../recipes-kernel/mcrc64/files/mcrc64.c      | 114 ++++++++++++++++++
  .../recipes-kernel/mcrc64/mcrc64.bb           |  18 +++
  3 files changed, 133 insertions(+)

create mode 100644 meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c create mode 100644 meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb

meta-arago-test/recipes-core/packagegroups/ti-test.bb +1 -0
index 814e3ea6..857e06fb 100644
@@ -31,6 +31,7 @@ TI_TEST_BASE = "\
      linuxptp \
      lmbench \
      lsof \
+    mcrc64 \
      media-ctl \
      memtester \
      mstpd \
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +114 -0
new file mode 100644
index 00000000..fc7a75d6
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2025 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <linux/if_alg.h>
+#include <string.h>
+
+#define BUFFER_SIZE 4096
+#define SECTOR 4096
+
+int main (int argc, char **argv) {
+
+    int desc[2] = { -1, -1 };
+
+    struct sockaddr_alg sock = {
+        .salg_family = AF_ALG,
+        .salg_type   = "hash",
+        .salg_name   = "crc64-iso3309"
+    };
+
+    if ((desc[0] = socket(AF_ALG, SOCK_SEQPACKET, 0)) == -1 ) {
+        perror("socket");
+        return -1;
+    }
+
+    if( bind(desc[0], (struct sockaddr *) &sock, sizeof(sock)) != 0 ) {
+        perror("bind");
+        return -1;
+    }
+
+    if( (desc[1] = accept(desc[0], NULL, 0)) == -1 )
+        return -1;
+
+    if (argc != 2 || strlen(argv[1]) == 0) {
+        printf("Please specify filename\n");
+        return -1; // empty string
+    }
+
+    FILE* file;
+    unsigned char *buffer;
+    if(posix_memalign((void *)&buffer, SECTOR, BUFFER_SIZE)) {
+        perror("posix_memalign failed");
+        return -1;
+    }
+
+    file = fopen(argv[1], "rb");
+    if(file == NULL)
+    {
+        printf("An error occured while opening file: %s\n", argv[1]);
+        free(buffer);
+        return -1;
+    }
+
+    while(!feof(file))
+    {
+        unsigned int count = fread(buffer, sizeof(char), BUFFER_SIZE, file);
+        if(ferror(file))
+        {
+            printf("An error occurred while accessing the file: %s\n", argv[1]);
+            fclose(file);
+            free(buffer);
+            return -1;
+        }
+
+        if (send(desc[1], buffer, count, MSG_MORE) != count) {
+            free(buffer);
+            return -1;
+        }
+    }
+
+    long int crc64 = 0x0000000000000000;
+    if(read(desc[1], &crc64, 8) != 8) {
+        free(buffer);
+        return -1;
+    }
+
+    printf("0x%llx\n", crc64);
+    free(buffer);
+    return 0;
+}
meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +8 -0
new file mode 100644
index 00000000..a707430d
@@ -0,0 +1,18 @@
+SUMMARY = "Application to test MCRC64 driver"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://mcrc64.c;beginline=1;endline=33;md5=070547e79367134fcfdf7fdb5e3ef7e3"
+
+SRC_URI = "file://mcrc64.c"
+
+S = "${WORKDIR}/sources"
+UNPACKDIR = "${S}"

meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb line 18

Quoted 10 lines
meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +10 -0
+
+do_compile() {
+	${CC} ${CFLAGS} ${LDFLAGS} ${UNPACKDIR}/mcrc64.c -o mcrc64
+}
+
+
+do_install() {
+	install -d ${D}${bindir}
+	install -m 0755 mcrc64 ${D}${bindir}
+}

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#15805):https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-arago/message/15805__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMLXSjQHz$ Mute This Topic:https://urldefense.com/v3/__https://lists.yoctoproject.org/mt/110988349/7030289__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMOPoo8w_$ Group Owner: [email protected]

Unsubscribe:https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-arago/unsub__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMDDbYZHU$  [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
#3 lore raw
Quoted 19 lines · Chirag Shilwant
Quoted 17 lines · Andrew Davis via lists.yoctoproject.org
Quoted 1 line · Aniket Limaye via lists. yoctoproject. org

From: Udit Kumar <u-kumar1@ ti. com> > > Add mcrc64 test

application recipe. > This application is documented at[0]. Why? Also the source shouldn't be here ZjQcmQRYFpfptBannerStart
This message was sent from outside of Texas Instruments.
Do not click links or open attachments unless you recognize the source of this email and know the content is safe. Report Suspicious
<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!uRdqV30l1mwbIKXEnDNjH0oo99olCbsPqm549YsQxoVJEzrvd9guIUd37GXbtnlWpwdZCGrcEUvq4uINTkJrifT6tlU$>

ZjQcmQRYFpfptBannerEnd

Quoted 3 lines · Aniket Limaye via lists.yoctoproject.org

From: Udit Kumar <[email protected]>

Quoted 1 line

Add mcrc64 test application recipe.

This application is documented at[0].

Why?

Quoted 9 lines
Quoted 2 lines

Also the source shouldn't be here in the yocto recipe, how do you expect the other distros we offer to make use of this?

+1 on Andrew's point

We already had a discussion on the above point with hwspinlocktest in past [1] which was reworked to go via GitHub way [2]

Thanks for examples

Quoted 2 lines

Let's not use meta-arago to be a placeholder for example applications

If this is policy decision, not to hold source code then fine

But with example given, I had mixed views

1) git is someone's public repo git://github.com/sumananna/omap-hwspinlock-test  ,

is this allowed ?

2) hwspinlocktests/files has c code and Makefile patches.

If policy is not to hold source code then IMO, above patches should be checked into above git

Quoted 222 lines

[1]: https://lists.yoctoproject.org/g/meta-arago/message/15577

[2]: https://lists.yoctoproject.org/g/meta-arago/message/15630

Signature · 1 line
Chirag
Quoted 212 lines

Put it on github, or if it specifically testing some kernel interface then maybe in the kernel source under tools/testing/crypto/ with the other crypto userspace tests.

Andrew

Quoted 1 line
Quoted 1 line

[0]:

https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j722s/10_01_00_04/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/MCRC64.html

Quoted 9 lines
Quoted 1 line

---
v3:
* Ryan:
- Maintain aplhabetical ordering of ti-test packages

Quoted 1 line

v2:

* Denys:
- Add required SUMMARY variable as per

https://urldefense.com/v3/__https://docs.yoctoproject.org/next/contributor-guide/recipe-style-guide.html*required-variables__;Iw!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMDFqsJ3A$

Quoted 3 lines

---
   .../recipes-core/packagegroups/ti-test.bb     |   1 + .../recipes-kernel/mcrc64/files/mcrc64.c      | 114

++++++++++++++++++

Quoted 3 lines

   .../recipes-kernel/mcrc64/mcrc64.bb           |  18 +++

   3 files changed, 133 insertions(+)

   create mode 100644

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 2 lines

   create mode 100644 meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb

Review

Quoted 1 line
(quoted diff) +0 -0

a/meta-arago-test/recipes-core/packagegroups/ti-test.bb b/meta-arago-test/recipes-core/packagegroups/ti-test.bb

Review

Quoted 12 lines

index 814e3ea6..857e06fb 100644

meta-arago-test/recipes-core/packagegroups/ti-test.bb +1 -0
@@ -31,6 +31,7 @@ TI_TEST_BASE = "\
        linuxptp \
        lmbench \
        lsof \
+    mcrc64 \
        media-ctl \
        memtester \
        mstpd \
(quoted diff) +0 -0

b/meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 2

Quoted 7 lines

new file mode 100644
index 00000000..fc7a75d6

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +2 -0
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2025 Texas Instruments Incorporated - 

http://www.ti.com/

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 3 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +3 -0
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or 

without

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 6

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  modification, are permitted provided that the following 

conditions

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 6 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +6 -0
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above 

copyright

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 13

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *    notice, this list of conditions and the following disclaimer 

in the

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 4 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +4 -0
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the 

names of

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 18

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *    its contributors may be used to endorse or promote products 

derived

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 3 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +3 -0
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 

CONTRIBUTORS

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 23

Quoted 2 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +2 -0
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 

FITNESS FOR

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 24

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 

COPYRIGHT

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 25

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 

INCIDENTAL,

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 27

Quoted 2 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +2 -0
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 

OF USE,

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 28

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 

ON ANY

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 29

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 

TORT

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 30

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 

THE USE

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 31

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 

DAMAGE.

Quoted 19 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +19 -0
+ *
+*/
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <linux/if_alg.h>
+#include <string.h>
+
+#define BUFFER_SIZE 4096
+#define SECTOR 4096
+
+int main (int argc, char **argv) {
+
+    int desc[2] = { -1, -1 };
+
+    struct sockaddr_alg sock = {
+        .salg_family = AF_ALG,

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 10 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +10 -0
+        .salg_type   = "hash",
+        .salg_name   = "crc64-iso3309"
+    };
+
+    if ((desc[0] = socket(AF_ALG, SOCK_SEQPACKET, 0)) == -1 ) {
+        perror("socket");
+        return -1;
+    }
+
+    if( bind(desc[0], (struct sockaddr *) &sock, sizeof(sock)) != 

0 ) {

Quoted 20 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +20 -0
+        perror("bind");
+        return -1;
+    }
+
+    if( (desc[1] = accept(desc[0], NULL, 0)) == -1 )
+        return -1;
+
+    if (argc != 2 || strlen(argv[1]) == 0) {
+        printf("Please specify filename\n");
+        return -1; // empty string
+    }
+
+    FILE* file;
+    unsigned char *buffer;
+    if(posix_memalign((void *)&buffer, SECTOR, BUFFER_SIZE)) {
+        perror("posix_memalign failed");
+        return -1;
+    }
+
+    file = fopen(argv[1], "rb");

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 10 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +10 -0
+    if(file == NULL)
+    {
+        printf("An error occured while opening file: %s\n", argv[1]);
+        free(buffer);
+        return -1;
+    }
+
+    while(!feof(file))
+    {
+        unsigned int count = fread(buffer, sizeof(char), 

BUFFER_SIZE, file);

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 3 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +3 -0
+        if(ferror(file))
+        {
+            printf("An error occurred while accessing the file: 

%s\n", argv[1]);

Review

Quoted 22 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +21 -0
+            fclose(file);
+            free(buffer);
+            return -1;
+        }
+
+        if (send(desc[1], buffer, count, MSG_MORE) != count) {
+            free(buffer);
+            return -1;
+        }
+    }
+
+    long int crc64 = 0x0000000000000000;
+    if(read(desc[1], &crc64, 8) != 8) {
+        free(buffer);
+        return -1;
+    }
+
+    printf("0x%llx\n", crc64);
+    free(buffer);
+    return 0;
+}
(quoted diff) +0 -0

b/meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb

meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb line 3

Quoted 8 lines

new file mode 100644
index 00000000..a707430d

meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +3 -0
@@ -0,0 +1,18 @@
+SUMMARY = "Application to test MCRC64 driver"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = 

"file://mcrc64.c;beginline=1;endline=33;md5=070547e79367134fcfdf7fdb5e3ef7e3"

Quoted 15 lines
meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +15 -0
+
+SRC_URI = "file://mcrc64.c"
+
+S = "${WORKDIR}/sources"
+UNPACKDIR = "${S}"
+
+do_compile() {
+    ${CC} ${CFLAGS} ${LDFLAGS} ${UNPACKDIR}/mcrc64.c -o mcrc64
+}
+
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 mcrc64 ${D}${bindir}
+}
#4 lore raw
Quoted 32 lines · Udit
Quoted 16 lines · Chirag Shilwant
Quoted 14 lines · Andrew Davis via lists.yoctoproject.org

On 2/4/25 1: 16 AM, Aniket Limaye via lists. yoctoproject. org wrote: > From: Udit Kumar <u-kumar1@ ti. com> > > Add mcrc64 test application recipe. > This application is documented at[0]. Why? Also the source shouldn't be here ZjQcmQRYFpfptBannerStart
This message was sent from outside of Texas Instruments.
Do not click links or open attachments unless you recognize the source of this email and know the content is safe.
Report Suspicious
<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!uRdqV30l1mwbIKXEnDNjH0oo99olCbsPqm549YsQxoVJEzrvd9guIUd37GXbtnlWpwdZCGrcEUvq4uINTkJrifT6tlU$>
ZjQcmQRYFpfptBannerEnd

Quoted 3 lines · Aniket Limaye via lists.yoctoproject.org

From: Udit Kumar <[email protected]>

Quoted 1 line

Add mcrc64 test application recipe.

This application is documented at[0].

Why?

Quoted 9 lines
Quoted 2 lines

Also the source shouldn't be here in the yocto recipe, how do you expect the other distros we offer to make use of this?

+1 on Andrew's point

We already had a discussion on the above point with hwspinlocktest in past [1] which was reworked to go via GitHub way [2]

Thanks for examples

Quoted 2 lines

Let's not use meta-arago to be a placeholder for example applications

Quoted 9 lines

If this is policy decision, not to hold source code then fine

But with example given, I had mixed views

1) git is someone's public repo git://github.com/sumananna/omap-hwspinlock-test  ,

is this allowed ?

It is perfectly fine to use someones personal repo as the source for a package. This is the nature of open source, most of the projects we use are just someones personal project in the end. We would have very little software if we only allowed official corporate-backed projects.

In this case, since Suman works for TI, we could probably go and at least clone that repo over to github.com/texasinstruments

Quoted 5 lines

2) hwspinlocktests/files has c code and Makefile patches.

If policy is not to hold source code then IMO, above patches should be checked into above git

Make a new project under github.com/texasinstruments for this application.

Andrew

Quoted 203 lines
Quoted 203 lines

[1]: https://lists.yoctoproject.org/g/meta-arago/message/15577

[2]: https://lists.yoctoproject.org/g/meta-arago/message/15630

Signature · 1 line
Chirag
Quoted 191 lines

Put it on github, or if it specifically testing some kernel interface then maybe in the kernel source under tools/testing/crypto/ with the other crypto userspace tests.

Andrew

Quoted 163 lines
Quoted 2 lines

[0]: https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j722s/10_01_00_04/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/MCRC64.html

---
v3:
* Ryan:
- Maintain aplhabetical ordering of ti-test packages

Quoted 1 line

v2:

* Denys:
- Add required SUMMARY variable as per https://urldefense.com/v3/__https://docs.yoctoproject.org/next/contributor-guide/recipe-style-guide.html*required-variables__;Iw!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMDFqsJ3A$
---
   .../recipes-core/packagegroups/ti-test.bb     |   1 +
   .../recipes-kernel/mcrc64/files/mcrc64.c      | 114 ++++++++++++++++++
   .../recipes-kernel/mcrc64/mcrc64.bb           |  18 +++

   3 files changed, 133 insertions(+)

   create mode 100644 meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c create mode 100644 meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb

meta-arago-test/recipes-core/packagegroups/ti-test.bb

Quoted 1 line
meta-arago-test/recipes-core/packagegroups/ti-test.bb +0 -0

index 814e3ea6..857e06fb 100644

meta-arago-test/recipes-core/packagegroups/ti-test.bb +1 -0
@@ -31,6 +31,7 @@ TI_TEST_BASE = "\
        linuxptp \
        lmbench \
        lsof \
+    mcrc64 \
        media-ctl \
        memtester \
        mstpd \
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +114 -0
new file mode 100644
index 00000000..fc7a75d6
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2025 Texas Instruments Incorporated - http://www.ti.com/
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the names of
+ *    its contributors may be used to endorse or promote products derived
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+*/
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <linux/if_alg.h>
+#include <string.h>
+
+#define BUFFER_SIZE 4096
+#define SECTOR 4096
+
+int main (int argc, char **argv) {
+
+    int desc[2] = { -1, -1 };
+
+    struct sockaddr_alg sock = {
+        .salg_family = AF_ALG,
+        .salg_type   = "hash",
+        .salg_name   = "crc64-iso3309"
+    };
+
+    if ((desc[0] = socket(AF_ALG, SOCK_SEQPACKET, 0)) == -1 ) {
+        perror("socket");
+        return -1;
+    }
+
+    if( bind(desc[0], (struct sockaddr *) &sock, sizeof(sock)) != 0 ) {
+        perror("bind");
+        return -1;
+    }
+
+    if( (desc[1] = accept(desc[0], NULL, 0)) == -1 )
+        return -1;
+
+    if (argc != 2 || strlen(argv[1]) == 0) {
+        printf("Please specify filename\n");
+        return -1; // empty string
+    }
+
+    FILE* file;
+    unsigned char *buffer;
+    if(posix_memalign((void *)&buffer, SECTOR, BUFFER_SIZE)) {
+        perror("posix_memalign failed");
+        return -1;
+    }
+
+    file = fopen(argv[1], "rb");
+    if(file == NULL)
+    {
+        printf("An error occured while opening file: %s\n", argv[1]);
+        free(buffer);
+        return -1;
+    }
+
+    while(!feof(file))
+    {
+        unsigned int count = fread(buffer, sizeof(char), BUFFER_SIZE, file);
+        if(ferror(file))
+        {
+            printf("An error occurred while accessing the file: %s\n", argv[1]);
+            fclose(file);
+            free(buffer);
+            return -1;
+        }
+
+        if (send(desc[1], buffer, count, MSG_MORE) != count) {
+            free(buffer);
+            return -1;
+        }
+    }
+
+    long int crc64 = 0x0000000000000000;
+    if(read(desc[1], &crc64, 8) != 8) {
+        free(buffer);
+        return -1;
+    }
+
+    printf("0x%llx\n", crc64);
+    free(buffer);
+    return 0;
+}
meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +8 -0
new file mode 100644
index 00000000..a707430d
@@ -0,0 +1,18 @@
+SUMMARY = "Application to test MCRC64 driver"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = "file://mcrc64.c;beginline=1;endline=33;md5=070547e79367134fcfdf7fdb5e3ef7e3"
+
+SRC_URI = "file://mcrc64.c"
+
+S = "${WORKDIR}/sources"
+UNPACKDIR = "${S}"

meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb line 18

Quoted 10 lines
meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +10 -0
+
+do_compile() {
+    ${CC} ${CFLAGS} ${LDFLAGS} ${UNPACKDIR}/mcrc64.c -o mcrc64
+}
+
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 mcrc64 ${D}${bindir}
+}

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#15805):https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-arago/message/15805__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMLXSjQHz$ Mute This Topic:https://urldefense.com/v3/__https://lists.yoctoproject.org/mt/110988349/7030289__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMOPoo8w_$ Group Owner: [email protected]

Unsubscribe:https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-arago/unsub__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMDDbYZHU$ [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
#5 lore raw
Quoted 34 lines · Andrew Davis
Quoted 33 lines · Udit
Quoted 17 lines · Chirag Shilwant
Quoted 15 lines · Andrew Davis via lists.yoctoproject.org

On 2/4/25 1: 16 AM, Aniket Limaye via lists. yoctoproject. org wrote: > From: Udit Kumar <u-kumar1@ ti. com> > > Add mcrc64 test application recipe. > This application is documented at[0]. Why? Also the source shouldn't be here ZjQcmQRYFpfptBannerStart
This message was sent from outside of Texas Instruments.
Do not click links or open attachments unless you recognize the source of this email and know the content is safe.
Report Suspicious
<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!uRdqV30l1mwbIKXEnDNjH0oo99olCbsPqm549YsQxoVJEzrvd9guIUd37GXbtnlWpwdZCGrcEUvq4uINTkJrifT6tlU$>

ZjQcmQRYFpfptBannerEnd

Quoted 3 lines · Aniket Limaye via lists.yoctoproject.org

From: Udit Kumar <[email protected]>

Quoted 1 line

Add mcrc64 test application recipe.

This application is documented at[0].

Why?

Quoted 9 lines
Quoted 2 lines

Also the source shouldn't be here in the yocto recipe, how do you expect the other distros we offer to make use of this?

+1 on Andrew's point

We already had a discussion on the above point with hwspinlocktest in past [1] which was reworked to go via GitHub way [2]

Thanks for examples

Quoted 2 lines

Let's not use meta-arago to be a placeholder for example applications

Quoted 8 lines
Quoted 8 lines

If this is policy decision, not to hold source code then fine

But with example given, I had mixed views

1) git is someone's public repo git://github.com/sumananna/omap-hwspinlock-test  ,

is this allowed ?

Yup it's alright, best example of a big SW piece which currently goes into SDK from a personal fork is mesa [1]

[1]: https://git.yoctoproject.org/meta-ti/tree/meta-ti-bsp/recipes-graphics/mesa/mesa-pvr_23.2.1.bb?h=scarthgap#n14

Quoted 256 lines
Quoted 2 lines

It is perfectly fine to use someones personal repo as the source for a package. This is the nature of open source, most of the projects we use are just someones personal project in the end. We would have very little software if we only allowed official corporate-backed projects.

In this case, since Suman works for TI, we could probably go and at least clone that repo over to github.com/texasinstruments

Quoted 5 lines

2) hwspinlocktests/files has c code and Makefile patches.

If policy is not to hold source code then IMO, above patches should be checked into above git

Make a new project under github.com/texasinstruments for this application.

Andrew

Quoted 234 lines
Quoted 234 lines

[1]: https://lists.yoctoproject.org/g/meta-arago/message/15577

[2]: https://lists.yoctoproject.org/g/meta-arago/message/15630

Signature · 1 line
Chirag
Quoted 222 lines

Put it on github, or if it specifically testing some kernel interface then maybe in the kernel source under tools/testing/crypto/ with the other crypto userspace tests.

Andrew

Quoted 1 line
Quoted 1 line

[0]:

https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j722s/10_01_00_04/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/MCRC64.html

Quoted 9 lines
Quoted 1 line

---
v3:
* Ryan:
- Maintain aplhabetical ordering of ti-test packages

Quoted 1 line

v2:

* Denys:
- Add required SUMMARY variable as per

https://urldefense.com/v3/__https://docs.yoctoproject.org/next/contributor-guide/recipe-style-guide.html*required-variables__;Iw!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMDFqsJ3A$

Quoted 3 lines

---
   .../recipes-core/packagegroups/ti-test.bb     |   1 + .../recipes-kernel/mcrc64/files/mcrc64.c      | 114

++++++++++++++++++

Quoted 3 lines

   .../recipes-kernel/mcrc64/mcrc64.bb           |  18 +++

   3 files changed, 133 insertions(+)

   create mode 100644

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 2 lines

   create mode 100644 meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb

Review

Quoted 1 line
(quoted diff) +0 -0

a/meta-arago-test/recipes-core/packagegroups/ti-test.bb b/meta-arago-test/recipes-core/packagegroups/ti-test.bb

Review

Quoted 12 lines

index 814e3ea6..857e06fb 100644

meta-arago-test/recipes-core/packagegroups/ti-test.bb +1 -0
@@ -31,6 +31,7 @@ TI_TEST_BASE = "\
        linuxptp \
        lmbench \
        lsof \
+    mcrc64 \
        media-ctl \
        memtester \
        mstpd \
(quoted diff) +0 -0

b/meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 2

Quoted 7 lines

new file mode 100644
index 00000000..fc7a75d6

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +2 -0
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2025 Texas Instruments Incorporated - 

http://www.ti.com/

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 3 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +3 -0
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or 

without

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 6

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  modification, are permitted provided that the following 

conditions

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 3 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +3 -0
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above 

copyright

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 3 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +3 -0
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above 

copyright

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 13

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *    notice, this list of conditions and the following 

disclaimer in the

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 4 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +4 -0
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the 

names of

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 18

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *    its contributors may be used to endorse or promote 

products derived

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 3 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +3 -0
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 

CONTRIBUTORS

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 22

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, 

BUT NOT

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 23

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 

FITNESS FOR

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 24

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 

COPYRIGHT

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 25

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 

INCIDENTAL,

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 26

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 

NOT

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 27

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 

LOSS OF USE,

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 28

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED 

AND ON ANY

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 29

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 

OR TORT

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 30

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT 

OF THE USE

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 31

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 

DAMAGE.

Quoted 19 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +19 -0
+ *
+*/
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <linux/if_alg.h>
+#include <string.h>
+
+#define BUFFER_SIZE 4096
+#define SECTOR 4096
+
+int main (int argc, char **argv) {
+
+    int desc[2] = { -1, -1 };
+
+    struct sockaddr_alg sock = {
+        .salg_family = AF_ALG,

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 10 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +10 -0
+        .salg_type   = "hash",
+        .salg_name   = "crc64-iso3309"
+    };
+
+    if ((desc[0] = socket(AF_ALG, SOCK_SEQPACKET, 0)) == -1 ) {
+        perror("socket");
+        return -1;
+    }
+
+    if( bind(desc[0], (struct sockaddr *) &sock, sizeof(sock)) 

!= 0 ) {

Quoted 13 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +13 -0
+        perror("bind");
+        return -1;
+    }
+
+    if( (desc[1] = accept(desc[0], NULL, 0)) == -1 )
+        return -1;
+
+    if (argc != 2 || strlen(argv[1]) == 0) {
+        printf("Please specify filename\n");
+        return -1; // empty string
+    }
+
+    FILE* file;

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 10 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +10 -0
+    unsigned char *buffer;
+    if(posix_memalign((void *)&buffer, SECTOR, BUFFER_SIZE)) {
+        perror("posix_memalign failed");
+        return -1;
+    }
+
+    file = fopen(argv[1], "rb");
+    if(file == NULL)
+    {
+        printf("An error occured while opening file: %s\n", 

argv[1]);

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 7 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +7 -0
+        free(buffer);
+        return -1;
+    }
+
+    while(!feof(file))
+    {
+        unsigned int count = fread(buffer, sizeof(char), 

BUFFER_SIZE, file);

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 3 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +3 -0
+        if(ferror(file))
+        {
+            printf("An error occurred while accessing the file: 

%s\n", argv[1]);

Review

Quoted 22 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +21 -0
+            fclose(file);
+            free(buffer);
+            return -1;
+        }
+
+        if (send(desc[1], buffer, count, MSG_MORE) != count) {
+            free(buffer);
+            return -1;
+        }
+    }
+
+    long int crc64 = 0x0000000000000000;
+    if(read(desc[1], &crc64, 8) != 8) {
+        free(buffer);
+        return -1;
+    }
+
+    printf("0x%llx\n", crc64);
+    free(buffer);
+    return 0;
+}
(quoted diff) +0 -0

b/meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb

meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb line 3

Quoted 8 lines

new file mode 100644
index 00000000..a707430d

meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +3 -0
@@ -0,0 +1,18 @@
+SUMMARY = "Application to test MCRC64 driver"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = 

"file://mcrc64.c;beginline=1;endline=33;md5=070547e79367134fcfdf7fdb5e3ef7e3"

Quoted 5 lines
meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +5 -0
+
+SRC_URI = "file://mcrc64.c"
+
+S = "${WORKDIR}/sources"
+UNPACKDIR = "${S}"

meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb line 18

Quoted 10 lines
meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +10 -0
+
+do_compile() {
+    ${CC} ${CFLAGS} ${LDFLAGS} ${UNPACKDIR}/mcrc64.c -o mcrc64
+}
+
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 mcrc64 ${D}${bindir}
+}

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#15805):https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-arago/message/15805__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMLXSjQHz$ Mute This Topic:https://urldefense.com/v3/__https://lists.yoctoproject.org/mt/110988349/7030289__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMOPoo8w_$ Group Owner: [email protected]

Unsubscribe:https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-arago/unsub__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMDDbYZHU$ [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
#6 lore raw
In reply to Kumar, Udit
Quoted 39 lines · Udit
Quoted 18 lines · Chirag Shilwant
Quoted 16 lines · Andrew Davis via lists.yoctoproject.org
Quoted 1 line · Aniket Limaye via lists. yoctoproject. org

From: Udit Kumar <u-kumar1@ ti. com> > > Add mcrc64 test

application recipe. > This application is documented at[0]. Why? Also the source shouldn't be here ZjQcmQRYFpfptBannerStart
This message was sent from outside of Texas Instruments.
Do not click links or open attachments unless you recognize the source of this email and know the content is safe. Report Suspicious
<https://us-phishalarm-ewt.proofpoint.com/EWT/v1/G3vK!uRdqV30l1mwbIKXEnDNjH0oo99olCbsPqm549YsQxoVJEzrvd9guIUd37GXbtnlWpwdZCGrcEUvq4uINTkJrifT6tlU$>
ZjQcmQRYFpfptBannerEnd

Quoted 3 lines · Aniket Limaye via lists.yoctoproject.org

From: Udit Kumar <[email protected]>

Quoted 1 line

Add mcrc64 test application recipe.

This application is documented at[0].

Why?

Quoted 9 lines
Quoted 2 lines

Also the source shouldn't be here in the yocto recipe, how do you expect the other distros we offer to make use of this?

+1 on Andrew's point

We already had a discussion on the above point with hwspinlocktest in past [1] which was reworked to go via GitHub way [2]

Thanks for examples

Quoted 2 lines

Let's not use meta-arago to be a placeholder for example applications

If this is policy decision, not to hold source code then fine

But with example given, I had mixed views

Quoted 8 lines

1) git is someone's public repo git://github.com/sumananna/omap-hwspinlock-test  ,

is this allowed ?

2) hwspinlocktests/files has c code and Makefile patches.

If policy is not to hold source code then IMO, above patches should be checked into above git

That is correct. We should create a repo and apply the above patches to the repository. That way other distros can use the same repo with all of the same changes. The only patches that are acceptable to carry in yocto log term are yocto specific build issue patches.

Quoted 230 lines
Quoted 230 lines

[1]: https://lists.yoctoproject.org/g/meta-arago/message/15577

[2]: https://lists.yoctoproject.org/g/meta-arago/message/15630

Signature · 1 line
Chirag
Quoted 218 lines

Put it on github, or if it specifically testing some kernel interface then maybe in the kernel source under tools/testing/crypto/ with the other crypto userspace tests.

Andrew

Quoted 1 line
Quoted 1 line

[0]:

https://software-dl.ti.com/jacinto7/esd/processor-sdk-linux-j722s/10_01_00_04/exports/docs/linux/Foundational_Components/Kernel/Kernel_Drivers/MCRC64.html

Quoted 9 lines
Quoted 1 line

---
v3:
* Ryan:
- Maintain aplhabetical ordering of ti-test packages

Quoted 1 line

v2:

* Denys:
- Add required SUMMARY variable as per

https://urldefense.com/v3/__https://docs.yoctoproject.org/next/contributor-guide/recipe-style-guide.html*required-variables__;Iw!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMDFqsJ3A$

Quoted 3 lines

---
   .../recipes-core/packagegroups/ti-test.bb     |   1 + .../recipes-kernel/mcrc64/files/mcrc64.c      | 114

++++++++++++++++++

Quoted 3 lines

   .../recipes-kernel/mcrc64/mcrc64.bb           |  18 +++

   3 files changed, 133 insertions(+)

   create mode 100644

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 2 lines

   create mode 100644 meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb

Review

Quoted 1 line
(quoted diff) +0 -0

a/meta-arago-test/recipes-core/packagegroups/ti-test.bb b/meta-arago-test/recipes-core/packagegroups/ti-test.bb

Review

Quoted 12 lines

index 814e3ea6..857e06fb 100644

meta-arago-test/recipes-core/packagegroups/ti-test.bb +1 -0
@@ -31,6 +31,7 @@ TI_TEST_BASE = "\
        linuxptp \
        lmbench \
        lsof \
+    mcrc64 \
        media-ctl \
        memtester \
        mstpd \
(quoted diff) +0 -0

b/meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 2

Quoted 7 lines

new file mode 100644
index 00000000..fc7a75d6

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +2 -0
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2025 Texas Instruments Incorporated - 

http://www.ti.com/

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 3 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +3 -0
+ *
+ *
+ *  Redistribution and use in source and binary forms, with or 

without

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 6

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  modification, are permitted provided that the following 

conditions

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 6 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +6 -0
+ *  are met:
+ *
+ *    Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ *
+ *    Redistributions in binary form must reproduce the above 

copyright

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 13

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *    notice, this list of conditions and the following disclaimer 

in the

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 4 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +4 -0
+ *    documentation and/or other materials provided with the
+ *    distribution.
+ *
+ *    Neither the name of Texas Instruments Incorporated nor the 

names of

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 18

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *    its contributors may be used to endorse or promote products 

derived

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 3 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +3 -0
+ *    from this software without specific prior written permission.
+ *
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND 

CONTRIBUTORS

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 23

Quoted 2 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +2 -0
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND 

FITNESS FOR

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 24

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 

COPYRIGHT

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 25

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 

INCIDENTAL,

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 27

Quoted 2 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +2 -0
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS 

OF USE,

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 28

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 

ON ANY

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 29

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR 

TORT

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 30

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF 

THE USE

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c line 31

Quoted 1 line
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +1 -0
+ *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 

DAMAGE.

Quoted 19 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +19 -0
+ *
+*/
+
+#include <unistd.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/socket.h>
+#include <linux/if_alg.h>
+#include <string.h>
+
+#define BUFFER_SIZE 4096
+#define SECTOR 4096
+
+int main (int argc, char **argv) {
+
+    int desc[2] = { -1, -1 };
+
+    struct sockaddr_alg sock = {
+        .salg_family = AF_ALG,

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 10 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +10 -0
+        .salg_type   = "hash",
+        .salg_name   = "crc64-iso3309"
+    };
+
+    if ((desc[0] = socket(AF_ALG, SOCK_SEQPACKET, 0)) == -1 ) {
+        perror("socket");
+        return -1;
+    }
+
+    if( bind(desc[0], (struct sockaddr *) &sock, sizeof(sock)) != 

0 ) {

Quoted 20 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +20 -0
+        perror("bind");
+        return -1;
+    }
+
+    if( (desc[1] = accept(desc[0], NULL, 0)) == -1 )
+        return -1;
+
+    if (argc != 2 || strlen(argv[1]) == 0) {
+        printf("Please specify filename\n");
+        return -1; // empty string
+    }
+
+    FILE* file;
+    unsigned char *buffer;
+    if(posix_memalign((void *)&buffer, SECTOR, BUFFER_SIZE)) {
+        perror("posix_memalign failed");
+        return -1;
+    }
+
+    file = fopen(argv[1], "rb");

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 10 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +10 -0
+    if(file == NULL)
+    {
+        printf("An error occured while opening file: %s\n", argv[1]);
+        free(buffer);
+        return -1;
+    }
+
+    while(!feof(file))
+    {
+        unsigned int count = fread(buffer, sizeof(char), 

BUFFER_SIZE, file);

meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c

Quoted 3 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +3 -0
+        if(ferror(file))
+        {
+            printf("An error occurred while accessing the file: 

%s\n", argv[1]);

Review

Quoted 22 lines
meta-arago-test/recipes-kernel/mcrc64/files/mcrc64.c new file +21 -0
+            fclose(file);
+            free(buffer);
+            return -1;
+        }
+
+        if (send(desc[1], buffer, count, MSG_MORE) != count) {
+            free(buffer);
+            return -1;
+        }
+    }
+
+    long int crc64 = 0x0000000000000000;
+    if(read(desc[1], &crc64, 8) != 8) {
+        free(buffer);
+        return -1;
+    }
+
+    printf("0x%llx\n", crc64);
+    free(buffer);
+    return 0;
+}
(quoted diff) +0 -0

b/meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb

meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb line 3

Quoted 8 lines

new file mode 100644
index 00000000..a707430d

meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +3 -0
@@ -0,0 +1,18 @@
+SUMMARY = "Application to test MCRC64 driver"
+LICENSE = "BSD-3-Clause"
+LIC_FILES_CHKSUM = 

"file://mcrc64.c;beginline=1;endline=33;md5=070547e79367134fcfdf7fdb5e3ef7e3"

Quoted 5 lines
meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +5 -0
+
+SRC_URI = "file://mcrc64.c"
+
+S = "${WORKDIR}/sources"
+UNPACKDIR = "${S}"

meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb line 18

Quoted 10 lines
meta-arago-test/recipes-kernel/mcrc64/mcrc64.bb new file +10 -0
+
+do_compile() {
+    ${CC} ${CFLAGS} ${LDFLAGS} ${UNPACKDIR}/mcrc64.c -o mcrc64
+}
+
+
+do_install() {
+    install -d ${D}${bindir}
+    install -m 0755 mcrc64 ${D}${bindir}
+}

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#15805):https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-arago/message/15805__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMLXSjQHz$ Mute This Topic:https://urldefense.com/v3/__https://lists.yoctoproject.org/mt/110988349/7030289__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMOPoo8w_$ Group Owner: [email protected]

Unsubscribe:https://urldefense.com/v3/__https://lists.yoctoproject.org/g/meta-arago/unsub__;!!G3vK!RlOQdh0cJ3K3zbE5UxljtaoX2scOlnmA4tUkGRsc-kjDqYQ1stPFBFu349vTtJfsd0G9jEzi0dwKrdux3ZabMDDbYZHU$ [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 3 lines
Ryan Eatmon                [email protected]
-----------------------------------------
Texas Instruments, Inc.  -  LCPD  -  MGTS