summaryrefslogtreecommitdiffstats
path: root/pbl/string.c
diff options
context:
space:
mode:
authorAhmad Fatoum <ahmad@a3f.at>2021-04-10 13:06:35 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-05-03 13:58:52 +0200
commitffcb31cdc3f20228ec0f82bcbc42162e336e2d87 (patch)
tree1b5ab4105ba64979aefe9e630559e6ce1bc117c9 /pbl/string.c
parent02b7eaf6ab6b7c5c5f83b8742f3e43991e4cff1d (diff)
downloadbarebox-ffcb31cdc3f20228ec0f82bcbc42162e336e2d87.tar.gz
barebox-ffcb31cdc3f20228ec0f82bcbc42162e336e2d87.tar.xz
PBL: fdt: implement fdt_device_get_match_data
Currently, the generic DT image can't properly have a PBL console, because it's only known at runtime what system we are running on. As we already parse the FDT in the PBL to get the memory regions, we could extract the board compatible as well and determine which UART to use. Add a helper to achieve this. Signed-off-by: Ahmad Fatoum <ahmad@a3f.at> Link: https://lore.barebox.org/20210410110638.2106658-1-ahmad@a3f.at Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'pbl/string.c')
-rw-r--r--pbl/string.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/pbl/string.c b/pbl/string.c
index e6c0997ebc..e96eb99fc2 100644
--- a/pbl/string.c
+++ b/pbl/string.c
@@ -7,6 +7,7 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/compiler.h>
+#include <linux/ctype.h>
void *memcpy(void *__dest, __const void *__src, size_t __n)
{
@@ -98,6 +99,17 @@ int strcmp(const char *cs, const char *ct)
return res;
}
+int strcasecmp(const char *s1, const char *s2)
+{
+ int c1, c2;
+
+ do {
+ c1 = tolower(*s1++);
+ c2 = tolower(*s2++);
+ } while (c1 == c2 && c1 != 0);
+ return c1 - c2;
+}
+
void *memchr(const void *s, int c, size_t count)
{
const unsigned char *p = s;