summaryrefslogtreecommitdiff
path: root/libdde_linux26
diff options
context:
space:
mode:
Diffstat (limited to 'libdde_linux26')
-rw-r--r--libdde_linux26/Makeconf2
-rw-r--r--libdde_linux26/include/linux/firmware.h75
-rw-r--r--libdde_linux26/mk/prog.mk1
3 files changed, 76 insertions, 2 deletions
diff --git a/libdde_linux26/Makeconf b/libdde_linux26/Makeconf
index 4ee54c66..00c59092 100644
--- a/libdde_linux26/Makeconf
+++ b/libdde_linux26/Makeconf
@@ -39,7 +39,7 @@ ifeq ($(ARCH), x86)
MY_DDE_INCDIR += $(OBJ_BASE)/include/linux-headers/asm/mach-default
endif
-PRIVATE_INCDIR += $(MY_DDE_INCDIR) $(MY_LINUX26_INCDIR) $(PKGDIR)/../libddekit/include
+PRIVATE_INCDIR += $(MY_DDE_INCDIR) $(MY_LINUX26_INCDIR) $(PKGDIR)/../libddekit
DEFINES += -D__KERNEL__ -DDDE_LINUX $(KBUILD_DEFINES)
CPPFLAGS += $(KBUILD_CPPFLAGS)
diff --git a/libdde_linux26/include/linux/firmware.h b/libdde_linux26/include/linux/firmware.h
new file mode 100644
index 00000000..06e7a1ce
--- /dev/null
+++ b/libdde_linux26/include/linux/firmware.h
@@ -0,0 +1,75 @@
+#ifndef _LINUX_FIRMWARE_H
+#define _LINUX_FIRMWARE_H
+
+#include <linux/module.h>
+#include <linux/types.h>
+#include <linux/compiler.h>
+
+#define FIRMWARE_NAME_MAX 30
+#define FW_ACTION_NOHOTPLUG 0
+#define FW_ACTION_HOTPLUG 1
+
+struct firmware {
+ size_t size;
+ const u8 *data;
+};
+
+struct device;
+
+struct builtin_fw {
+ char *name;
+ void *data;
+ unsigned long size;
+};
+
+/* We have to play tricks here much like stringify() to get the
+ __COUNTER__ macro to be expanded as we want it */
+#define __fw_concat1(x, y) x##y
+#define __fw_concat(x, y) __fw_concat1(x, y)
+
+#define DECLARE_BUILTIN_FIRMWARE(name, blob) \
+ DECLARE_BUILTIN_FIRMWARE_SIZE(name, &(blob), sizeof(blob))
+
+#define DECLARE_BUILTIN_FIRMWARE_SIZE(name, blob, size) \
+ static const struct builtin_fw __fw_concat(__builtin_fw,__COUNTER__) \
+ __used __section(.builtin_fw) = { name, blob, size }
+
+#if defined(CONFIG_FW_LOADER) || (defined(CONFIG_FW_LOADER_MODULE) && defined(MODULE))
+int request_firmware(const struct firmware **fw, const char *name,
+ struct device *device);
+int request_firmware_nowait(
+ struct module *module, int uevent,
+ const char *name, struct device *device, void *context,
+ void (*cont)(const struct firmware *fw, void *context));
+
+void release_firmware(const struct firmware *fw);
+#else
+#ifdef DDE_LINUX
+#include <ddekit/printf.h>
+#endif
+static inline int request_firmware(const struct firmware **fw,
+ const char *name,
+ struct device *device)
+{
+#ifdef DDE_LINUX
+ ddekit_printf("firmware %s requested, but not implemented\n", name);
+#endif
+ return -EINVAL;
+}
+static inline int request_firmware_nowait(
+ struct module *module, int uevent,
+ const char *name, struct device *device, void *context,
+ void (*cont)(const struct firmware *fw, void *context))
+{
+#ifdef DDE_LINUX
+ ddekit_printf("firmware %s requested, but not implemented\n", name);
+#endif
+ return -EINVAL;
+}
+
+static inline void release_firmware(const struct firmware *fw)
+{
+}
+#endif
+
+#endif
diff --git a/libdde_linux26/mk/prog.mk b/libdde_linux26/mk/prog.mk
index d54c38e9..c1d5d9a8 100644
--- a/libdde_linux26/mk/prog.mk
+++ b/libdde_linux26/mk/prog.mk
@@ -56,7 +56,6 @@ TARGET_STANDARD := $(TARGET) $(TARGET_$(OSYSTEM))
TARGET_PROFILE := $(addsuffix .pr,$(filter $(BUILD_PROFILE),$(TARGET)))
TARGET += $(TARGET_$(OSYSTEM)) $(TARGET_PROFILE)
-CFLAGS += $(DDEKITINCDIR)
# define some variables different for lib.mk and prog.mk
ifeq ($(MODE),loader)
LDFLAGS += --dynamic-linker libld-l4.s.so