summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-04-07 09:59:35 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-04-07 09:59:35 +0200
commit4cd023c77942f48efded3e9e47c2be823d5c8d82 (patch)
treeb6790388da4c11d50cc7b22ee915fc6133b051c0 /include
parent011aec6558e93b01c64202929a6ae90a334a3742 (diff)
parente4f81050e098074792730b61563538d9e394e3d6 (diff)
downloadbarebox-4cd023c77942f48efded3e9e47c2be823d5c8d82.tar.gz
barebox-4cd023c77942f48efded3e9e47c2be823d5c8d82.tar.xz
Merge branch 'for-next/misc'
Diffstat (limited to 'include')
-rw-r--r--include/ata_drive.h3
-rw-r--r--include/boot.h2
-rw-r--r--include/bootchooser.h4
-rw-r--r--include/common.h3
-rw-r--r--include/globalvar.h12
-rw-r--r--include/linux/clk.h31
-rw-r--r--include/param.h1
-rw-r--r--include/poweroff.h21
8 files changed, 53 insertions, 24 deletions
diff --git a/include/ata_drive.h b/include/ata_drive.h
index 44073cb1b1..11685eef12 100644
--- a/include/ata_drive.h
+++ b/include/ata_drive.h
@@ -37,8 +37,10 @@
#define ATA_CMD_ID_ATA 0xEC
#define ATA_CMD_READ 0x20
+#define ATA_CMD_PIO_READ_EXT 0x24
#define ATA_CMD_READ_EXT 0x25
#define ATA_CMD_WRITE 0x30
+#define ATA_CMD_PIO_WRITE_EXT 0x34
#define ATA_CMD_WRITE_EXT 0x35
/* drive's status flags */
@@ -140,6 +142,7 @@ struct ata_port {
void *drvdata;
struct block_device blk;
uint16_t *id;
+ int lba48;
int initialized;
int probe;
};
diff --git a/include/boot.h b/include/boot.h
index a855cbe1e5..4f7612ab80 100644
--- a/include/boot.h
+++ b/include/boot.h
@@ -36,6 +36,8 @@ struct bootentry {
int bootentries_add_entry(struct bootentries *entries, struct bootentry *entry);
+int bootentry_register_provider(int (*fn)(struct bootentries *bootentries, const char *name));
+
#define bootentries_for_each_entry(bootentries, entry) \
list_for_each_entry(entry, &bootentries->entries, list)
diff --git a/include/bootchooser.h b/include/bootchooser.h
index c948247722..7822c01459 100644
--- a/include/bootchooser.h
+++ b/include/bootchooser.h
@@ -13,14 +13,14 @@ int bootchooser_put(struct bootchooser *bootchooser);
void bootchooser_info(struct bootchooser *bootchooser);
+int bootchooser_boot(struct bootchooser *bc);
+
struct bootchooser_target *bootchooser_get_last_chosen(struct bootchooser *bootchooser);
const char *bootchooser_target_name(struct bootchooser_target *target);
struct bootchooser_target *bootchooser_target_by_name(struct bootchooser *bootchooser,
const char *name);
void bootchooser_target_force_boot(struct bootchooser_target *target);
-int bootchooser_create_bootentry(struct bootentries *entries);
-
int bootchooser_target_set_attempts(struct bootchooser_target *target, int attempts);
int bootchooser_target_set_priority(struct bootchooser_target *target, int priority);
diff --git a/include/common.h b/include/common.h
index 680a0affb6..dd7445e9b6 100644
--- a/include/common.h
+++ b/include/common.h
@@ -66,9 +66,6 @@ int readline (const char *prompt, char *buf, int len);
/* common/memsize.c */
long get_ram_size (volatile long *, long);
-/* $(CPU)/cpu.c */
-void __noreturn poweroff(void);
-
/* common/console.c */
int ctrlc (void);
diff --git a/include/globalvar.h b/include/globalvar.h
index 80bc53e680..df43f1fe66 100644
--- a/include/globalvar.h
+++ b/include/globalvar.h
@@ -11,10 +11,6 @@ extern struct device_d global_device;
#ifdef CONFIG_GLOBALVAR
int globalvar_add_simple(const char *name, const char *value);
-int globalvar_add(const char *name,
- int (*set)(struct device_d *dev, struct param_d *p, const char *val),
- const char *(*get)(struct device_d *, struct param_d *p),
- unsigned long flags);
void globalvar_remove(const char *name);
char *globalvar_get_match(const char *match, const char *separator);
void globalvar_set_match(const char *match, const char *val);
@@ -80,14 +76,6 @@ static inline int globalvar_add_simple_ip(const char *name,
return 0;
}
-static inline int globalvar_add(const char *name,
- int (*set)(struct device_d *dev, struct param_d *p, const char *val),
- const char *(*get)(struct device_d *, struct param_d *p),
- unsigned long flags)
-{
- return 0;
-}
-
static inline void globalvar_remove(const char *name) {}
static inline void globalvar_print(void) {}
diff --git a/include/linux/clk.h b/include/linux/clk.h
index a061398555..081a859729 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -324,16 +324,13 @@ struct clk *clk_register_composite(const char *name,
struct device_node;
struct of_phandle_args;
+#if defined(CONFIG_COMMON_CLK_OF_PROVIDER)
+
#define CLK_OF_DECLARE(name, compat, fn) \
const struct of_device_id __clk_of_table_##name \
__attribute__ ((unused,section (".__clk_of_table"))) \
= { .compatible = compat, .data = fn }
-#if defined(CONFIG_COMMON_CLK_OF_PROVIDER)
-int of_clk_add_provider(struct device_node *np,
- struct clk *(*clk_src_get)(struct of_phandle_args *args,
- void *data),
- void *data);
void of_clk_del_provider(struct device_node *np);
typedef int (*of_clk_init_cb_t)(struct device_node *);
@@ -349,11 +346,27 @@ struct clk *of_clk_get(struct device_node *np, int index);
struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
unsigned int of_clk_get_parent_count(struct device_node *np);
-char *of_clk_get_parent_name(struct device_node *np, unsigned int index);
int of_clk_parent_fill(struct device_node *np, const char **parents,
unsigned int size);
int of_clk_init(struct device_node *root, const struct of_device_id *matches);
#else
+
+
+/*
+ * Create a dummy variable to avoid 'unused function'
+ * warnings. Compiler should be smart enough to throw it out.
+ */
+#define CLK_OF_DECLARE(name, compat, fn) \
+static const struct of_device_id __clk_of_table_##name \
+__attribute__ ((unused)) = { .data = fn }
+
+
+static inline struct clk *
+of_clk_src_simple_get(struct of_phandle_args *clkspec, void *data)
+{
+ return ERR_PTR(-ENOENT);
+}
+
static inline struct clk *of_clk_get(struct device_node *np, int index)
{
return ERR_PTR(-ENOENT);
@@ -374,4 +387,10 @@ struct string_list;
int clk_name_complete(struct string_list *sl, char *instr);
+int of_clk_add_provider(struct device_node *np,
+ struct clk *(*clk_src_get)(struct of_phandle_args *args,
+ void *data),
+ void *data);
+char *of_clk_get_parent_name(struct device_node *np, unsigned int index);
+
#endif
diff --git a/include/param.h b/include/param.h
index f5f82ee70c..f9f3398cae 100644
--- a/include/param.h
+++ b/include/param.h
@@ -6,7 +6,6 @@
#include <linux/list.h>
#define PARAM_FLAG_RO (1 << 0)
-#define PARAM_GLOBALVAR_UNQUALIFIED (1 << 1)
struct device_d;
typedef uint32_t IPaddr_t;
diff --git a/include/poweroff.h b/include/poweroff.h
new file mode 100644
index 0000000000..ae9557db5d
--- /dev/null
+++ b/include/poweroff.h
@@ -0,0 +1,21 @@
+#ifndef __INCLUDE_POWEROFF_H
+#define __INCLUDE_POWEROFF_H
+
+void __noreturn poweroff_machine(void);
+
+struct poweroff_handler {
+ void (*poweroff)(struct poweroff_handler *);
+ int priority;
+ const char *name;
+ struct list_head list;
+};
+
+int poweroff_handler_register(struct poweroff_handler *);
+int poweroff_handler_register_fn(void (*poweroff_fn)(struct poweroff_handler *));
+
+#define POWEROFF_DEFAULT_PRIORITY 100
+#define POWEROFF_DEFAULT_NAME "default"
+
+unsigned int of_get_poweroff_priority(struct device_node *node);
+
+#endif /* __INCLUDE_POWEROFF_H */