summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2007-07-05 18:01:24 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-07-05 18:01:24 +0200
commit55ebf67d3ec2b0727f86a54157a2740e9e8472c3 (patch)
tree01fde5994de0c51b4701750464c73f750c6b754e /include
parent4eae36cc43b290ed74929d925987d8f2fe8a888e (diff)
downloadbarebox-55ebf67d3ec2b0727f86a54157a2740e9e8472c3.tar.gz
barebox-55ebf67d3ec2b0727f86a54157a2740e9e8472c3.tar.xz
svn_rev_120
implement initcalls
Diffstat (limited to 'include')
-rw-r--r--include/asm-arm/u-boot-arm.h1
-rw-r--r--include/asm-generic/u-boot.lds.h11
-rw-r--r--include/configs/scb9328.h3
-rw-r--r--include/driver.h13
-rw-r--r--include/init.h16
-rw-r--r--include/net.h7
6 files changed, 46 insertions, 5 deletions
diff --git a/include/asm-arm/u-boot-arm.h b/include/asm-arm/u-boot-arm.h
index efff5e9902..e21d164aa5 100644
--- a/include/asm-arm/u-boot-arm.h
+++ b/include/asm-arm/u-boot-arm.h
@@ -37,7 +37,6 @@ extern ulong IRQ_STACK_START; /* top of IRQ stack */
extern ulong FIQ_STACK_START; /* top of FIQ stack */
/* cpu/.../cpu.c */
-int cpu_init(void);
int cleanup_before_linux(void);
/* board/.../... */
diff --git a/include/asm-generic/u-boot.lds.h b/include/asm-generic/u-boot.lds.h
new file mode 100644
index 0000000000..a0ecf727ab
--- /dev/null
+++ b/include/asm-generic/u-boot.lds.h
@@ -0,0 +1,11 @@
+
+#define INITCALLS \
+ *(.initcall.0) \
+ *(.initcall.1) \
+ *(.initcall.2) \
+ *(.initcall.3) \
+ *(.initcall.4) \
+ *(.initcall.5) \
+ *(.initcall.6) \
+ *(.initcall.7)
+
diff --git a/include/configs/scb9328.h b/include/configs/scb9328.h
index 629d863a06..632939ec54 100644
--- a/include/configs/scb9328.h
+++ b/include/configs/scb9328.h
@@ -87,6 +87,9 @@
#define PRECHARGE_CMD 0x910a8200
#define AUTOREFRESH_CMD 0xa10a8200
+#define CONFIG_ARCH_NUMBER MACH_TYPE_SCB9328
+#define CONFIG_BOOT_PARAMS 0x08000100
+
/*
* SDRAM Memory Map
*/
diff --git a/include/driver.h b/include/driver.h
index 23e84a04c3..848f844ec2 100644
--- a/include/driver.h
+++ b/include/driver.h
@@ -8,6 +8,11 @@
struct memarea_info;
+#define DEVICE_TYPE_UNKNOWN 0
+#define DEVICE_TYPE_ETHER 1
+#define DEVICE_TYPE_STDIO 2
+#define MAX_DEVICE_TYPE 2
+
struct device_d {
char name[MAX_DRIVER_NAME];
char id[MAX_DRIVER_NAME];
@@ -26,6 +31,8 @@ struct device_d {
struct driver_d *driver;
struct device_d *next;
+
+ unsigned long type;
};
struct driver_d {
@@ -40,6 +47,9 @@ struct driver_d {
void (*info) (struct device_d *);
void (*shortinfo) (struct device_d *);
+
+ unsigned long type;
+ void *type_data;
};
#define RW_SIZE(x) (x)
@@ -59,5 +69,8 @@ ssize_t erase(struct device_d *dev, size_t count, unsigned long offset);
ssize_t mem_read(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags);
ssize_t mem_write(struct device_d *dev, void *buf, size_t count, ulong offset, ulong flags);
+int register_device_type_handler(int(*handle)(struct device_d *), ulong device_type);
+//void unregister_device_type_handler(struct device_d *);
+
#endif /* DRIVER_H */
diff --git a/include/init.h b/include/init.h
new file mode 100644
index 0000000000..06d1174e6f
--- /dev/null
+++ b/include/init.h
@@ -0,0 +1,16 @@
+#ifndef _INIT_H
+#define _INIT_H
+
+typedef int (*initcall_t)(void);
+
+#define __define_initcall(level,fn,id) \
+ static initcall_t __initcall_##fn##id __attribute__((__used__)) \
+ __attribute__((__section__(".initcall." level))) = fn
+
+
+#define core_initcall(fn) __define_initcall("0",fn,0)
+#define device_initcall(fn) __define_initcall("5",fn,5)
+#define late_initcall(fn) __define_initcall("6",fn,6)
+
+#endif /* _INIT_H */
+
diff --git a/include/net.h b/include/net.h
index 99b3d7d982..6c78e1d628 100644
--- a/include/net.h
+++ b/include/net.h
@@ -98,8 +98,8 @@ struct eth_device {
int iobase;
int state;
- int (*init) (struct eth_device*, bd_t*);
- int (*open) (struct eth_device*, bd_t*);
+ int (*init) (struct eth_device*);
+ int (*open) (struct eth_device*);
int (*send) (struct eth_device*, volatile void* pachet, int length);
int (*recv) (struct eth_device*);
void (*halt) (struct eth_device*);
@@ -110,7 +110,6 @@ struct eth_device {
void *priv;
};
-extern int eth_initialize(bd_t *bis); /* Initialize network subsystem */
extern int eth_register(struct eth_device* dev);/* Register network device */
extern void eth_try_another(int first_restart); /* Change the device */
extern struct eth_device *eth_get_dev(void); /* get the current device MAC */
@@ -118,7 +117,7 @@ extern struct eth_device *eth_get_dev_by_name(char *devname); /* get device */
extern int eth_get_dev_index (void); /* get the device index */
extern void eth_set_enetaddr(int num, char* a); /* Set new MAC address */
-extern int eth_init(bd_t *bis); /* Initialize the device */
+extern int eth_init(void); /* Initialize the device */
extern int eth_send(volatile void *packet, int length); /* Send a packet */
extern int eth_rx(void); /* Check for received packets */
extern void eth_halt(void); /* stop SCC */