summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/Makefile9
-rw-r--r--examples/smc91111_eeprom.c6
-rw-r--r--examples/stubs.c13
3 files changed, 24 insertions, 4 deletions
diff --git a/examples/Makefile b/examples/Makefile
index 2f8c4c4..fee2674 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -53,6 +53,10 @@ ifeq ($(ARCH),microblaze)
LOAD_ADDR = 0x80F00000
endif
+ifeq ($(ARCH),blackfin)
+LOAD_ADDR = 0x1000
+endif
+
include $(TOPDIR)/config.mk
SREC = hello_world.srec
@@ -73,6 +77,11 @@ SREC += sched.srec
BIN += sched.bin sched
endif
+ifeq ($(ARCH),blackfin)
+SREC += smc91111_eeprom.srec
+BIN += smc91111_eeprom.bin smc91111_eeprom
+endif
+
# The following example is pretty 8xx specific...
ifeq ($(CPU),mpc8xx)
SREC += timer.srec
diff --git a/examples/smc91111_eeprom.c b/examples/smc91111_eeprom.c
index 885f933..98e3e86 100644
--- a/examples/smc91111_eeprom.c
+++ b/examples/smc91111_eeprom.c
@@ -214,13 +214,11 @@ int smc91111_eeprom (int argc, char *argv[])
switch (what) {
case 1:
- printf ("Writing EEPROM register %02x with %04x\n",
- reg, value);
+ printf ("Writing EEPROM register %02x with %04x\n", reg, value);
write_eeprom_reg (value, reg);
break;
case 2:
- printf ("Writing MAC register bank %i,
- reg %02x with %04x\n", reg >> 4, reg & 0xE, value);
+ printf ("Writing MAC register bank %i, reg %02x with %04x\n", reg >> 4, reg & 0xE, value);
SMC_SELECT_BANK (reg >> 4);
SMC_outw (value, reg & 0xE);
break;
diff --git a/examples/stubs.c b/examples/stubs.c
index d4c6e06..1797274 100644
--- a/examples/stubs.c
+++ b/examples/stubs.c
@@ -125,6 +125,19 @@ gd_t *global_data;
" lwi r5, r5, %1\n" \
" bra r5\n" \
: : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "r5");
+#elif defined(CONFIG_BLACKFIN)
+/*
+ * P5 holds the pointer to the global_data, P0 is a call-clobbered
+ * register
+ */
+#define EXPORT_FUNC(x) \
+ asm volatile ( \
+" .globl " #x "\n" \
+#x ":\n" \
+" P0 = [P5 + %0]\n" \
+" P0 = [P0 + %1]\n" \
+" JUMP (P0)\n" \
+ : : "i"(offsetof(gd_t, jt)), "i"(XF_ ## x * sizeof(void *)) : "P0");
#else
#error stubs definition missing for this architecture
#endif