Skip to contentSkip to conversation

devmem2: the source and patches moved to github repo

PATCH New Denys Dmytriyenko 1 participant 1 message May 30, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 devmem2: the source and patches moved to github repo

To cleanup metadata and improve source code management, github repo was created here with all patches integrated:
https://github.com/denix0/devmem2

Update recipe accordingly, bump the version while at it to distinguish from the original.

---
 ...word-is-32-bit-and-add-support-for-6.patch | 70 --------------
 ...ort-different-page-sizes-at-run-time.patch | 35 -------
 .../devmem2/devmem2/devmem2-fixups-2.patch    | 91 -------------------
 .../devmem2/{devmem2.bb => devmem2_2.0.bb}    | 17 +---
 4 files changed, 3 insertions(+), 210 deletions(-)
 delete mode 100644 meta-oe/recipes-support/devmem2/devmem2/0001-devmem.c-ensure-word-is-32-bit-and-add-support-for-6.patch
 delete mode 100644 meta-oe/recipes-support/devmem2/devmem2/0001-devmem2-support-different-page-sizes-at-run-time.patch
 delete mode 100644 meta-oe/recipes-support/devmem2/devmem2/devmem2-fixups-2.patch
 rename meta-oe/recipes-support/devmem2/{devmem2.bb => devmem2_2.0.bb} (40%)
meta-oe/recipes-support/devmem2/devmem2/0001-devmem.c-ensure-word-is-32-bit-and-add-support-for-6.patch deleted +0 -70
deleted file mode 100644
index 2a57f2989..000000000
@@ -1,70 +0,0 @@
-From 1360a907879dd24041797a3b709d49aeac2ab444 Mon Sep 17 00:00:00 2001
-From: Denys Dmytriyenko <[email protected]>
-Date: Tue, 29 May 2018 16:55:42 -0400
-Subject: [PATCH] devmem.c: ensure word is 32-bit and add support for 64-bit
- long
-
-Signed-off-by: Denys Dmytriyenko <[email protected]>
----
- devmem2.c | 23 +++++++++++++++++------
- 1 file changed, 17 insertions(+), 6 deletions(-)
-
-diff --git a/devmem2.c b/devmem2.c
-index 5845381..68131b2 100644
---- a/devmem2.c
-+++ b/devmem2.c
-@@ -39,6 +39,7 @@
- 
- #include <stdio.h>
- #include <stdlib.h>
-+#include <stdint.h>
- #include <unistd.h>
- #include <string.h>
- #include <errno.h>
-@@ -69,7 +70,7 @@ int main(int argc, char **argv) {
- 	if(argc < 2) {
- 		fprintf(stderr, "\nUsage:\t%s { address } [ type [ data ] ]\n"
- 			"\taddress : memory address to act upon\n"
--			"\ttype    : access operation type : [b]yte, [h]alfword, [w]ord\n"
-+			"\ttype    : access operation type : [b]yte, [h]alfword, [w]ord, [l]ong\n"
- 			"\tdata    : data to be written\n\n",
- 			argv[0]);
- 		exit(1);
-@@ -103,9 +104,14 @@ int main(int argc, char **argv) {
- 			read_result = *((unsigned short *) virt_addr);
- 			break;
- 		case 'w':
--			data_size = sizeof(unsigned long);
-+			data_size = sizeof(uint32_t);
- 			virt_addr = fixup_addr(virt_addr, data_size);
--			read_result = *((unsigned long *) virt_addr);
-+			read_result = *((uint32_t *) virt_addr);
-+			break;
-+		case 'l':
-+			data_size = sizeof(uint64_t);
-+			virt_addr = fixup_addr(virt_addr, data_size);
-+			read_result = *((uint64_t *) virt_addr);
- 			break;
- 		default:
- 			fprintf(stderr, "Illegal data type '%c'.\n", access_type);
-@@ -129,9 +135,14 @@ int main(int argc, char **argv) {
- 				read_result = *((unsigned short *) virt_addr);
- 				break;
- 			case 'w':
--				virt_addr = fixup_addr(virt_addr, sizeof(unsigned long));
--				*((unsigned long *) virt_addr) = write_val;
--				read_result = *((unsigned long *) virt_addr);
-+				virt_addr = fixup_addr(virt_addr, sizeof(uint32_t));
-+				*((uint32_t *) virt_addr) = write_val;
-+				read_result = *((uint32_t *) virt_addr);
-+				break;
-+			case 'l':
-+				virt_addr = fixup_addr(virt_addr, sizeof(uint64_t));
-+				*((uint64_t *) virt_addr) = write_val;
-+				read_result = *((uint64_t *) virt_addr);
- 				break;
- 		}
- 		sprintf(fmt_str, "Write at address 0x%%08lX (%%p): 0x%%0%dlX, "
--- 
-2.7.4
-
meta-oe/recipes-support/devmem2/devmem2/0001-devmem2-support-different-page-sizes-at-run-time.patch deleted +0 -35
deleted file mode 100644
index 0da0732c5..000000000
@@ -1,35 +0,0 @@
-From 0f6af48b2fbc71ec8abe862d3e9eb6da7b03538b Mon Sep 17 00:00:00 2001
-From: Denys Dmytriyenko <[email protected]>
-Date: Wed, 8 Aug 2018 14:38:00 -0400
-Subject: [PATCH] devmem2: support different page sizes at run-time
-
-Signed-off-by: Denys Dmytriyenko <[email protected]>
----
- devmem2.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/devmem2.c b/devmem2.c
-index 68131b2..76af2d6 100644
---- a/devmem2.c
-+++ b/devmem2.c
-@@ -53,8 +53,6 @@
- #define FATAL do { fprintf(stderr, "Error at line %d, file %s (%d) [%s]\n", \
-   __LINE__, __FILE__, errno, strerror(errno)); exit(1); } while(0)
-  
--#define MAP_SIZE 4096UL
--#define MAP_MASK (MAP_SIZE - 1)
- 
- static inline void *fixup_addr(void *addr, size_t size);
- 
-@@ -66,6 +64,8 @@ int main(int argc, char **argv) {
- 	int access_type = 'w';
- 	char fmt_str[128];
- 	size_t data_size;
-+	unsigned long MAP_SIZE = sysconf(_SC_PAGE_SIZE);
-+	unsigned long MAP_MASK = (MAP_SIZE - 1);
- 	
- 	if(argc < 2) {
- 		fprintf(stderr, "\nUsage:\t%s { address } [ type [ data ] ]\n"
--- 
-2.7.4
-
meta-oe/recipes-support/devmem2/devmem2/devmem2-fixups-2.patch deleted +0 -91

91 lines not on this page · raw message

meta-oe/recipes-support/devmem2/devmem2_2.0.bb renamed from meta-oe/recipes-support/devmem2/devmem2.bb +3 -14
similarity index 40%
rename from meta-oe/recipes-support/devmem2/devmem2.bb
rename to meta-oe/recipes-support/devmem2/devmem2_2.0.bb
index 70d413521..aee6bfe3d 100644
@@ -1,22 +1,14 @@
 SUMMARY = "Simple program to read/write from/to any location in memory"
 LICENSE = "GPL-2.0-or-later"
 LIC_FILES_CHKSUM = "file://devmem2.c;endline=38;md5=a9eb9f3890384519f435aedf986297cf"
-PR = "r7"
 
-SRC_URI = "https://bootlin.com/pub/mirror/devmem2.c;downloadfilename=devmem2-new.c \
-           file://devmem2-fixups-2.patch;apply=yes;striplevel=0 \
-           file://0001-devmem.c-ensure-word-is-32-bit-and-add-support-for-6.patch \
-           file://0001-devmem2-support-different-page-sizes-at-run-time.patch \
-"
+SRC_URI = "git://github.com/denix0/devmem2.git;protocol=https;branch=main"
+SRCREV = "5b395a946894eb4f4ef5d07c80a50a88573a541e"
 
-S = "${WORKDIR}"
+S = "${WORKDIR}/git"
 
 CFLAGS += "-DFORCE_STRICT_ALIGNMENT"
 
-python do_unpack:append() {
-    os.rename("devmem2-new.c", "devmem2.c")
-}
-
 do_compile() {
     ${CC} -o devmem2 devmem2.c ${CFLAGS} ${LDFLAGS}
 }
@@ -25,6 +17,3 @@ do_install() {
     install -d ${D}${bindir}
     install devmem2 ${D}${bindir}
 }
-
-SRC_URI[md5sum] = "e23f236e94be4c429aa1ceac0f01544b"
-SRC_URI[sha256sum] = "3b15515693bae1ebd14d914e46d388edfec2175829ea1576a7a0c8606ebbe639"
Signature · 1 line
2.25.1