diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/Makefile | 11 | ||||
-rw-r--r-- | examples/mem_to_mem_idma2intr.c | 4 | ||||
-rw-r--r-- | examples/smc91111_eeprom.c | 6 | ||||
-rw-r--r-- | examples/stubs.c | 15 | ||||
-rw-r--r-- | examples/timer.c | 4 |
5 files changed, 30 insertions, 10 deletions
diff --git a/examples/Makefile b/examples/Makefile index 2f8c4c4035..a342d75062 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -42,7 +42,7 @@ LOAD_ADDR = 0x00800000 -L $(gcclibdir)/m32 -T nios.lds endif ifeq ($(ARCH),nios2) -LOAD_ADDR = 0x00800000 -L $(gcclibdir) -T nios2.lds +LOAD_ADDR = 0x02000000 -L $(gcclibdir) -T nios2.lds endif ifeq ($(ARCH),m68k) @@ -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/mem_to_mem_idma2intr.c b/examples/mem_to_mem_idma2intr.c index 3a269c9082..3ff28041f8 100644 --- a/examples/mem_to_mem_idma2intr.c +++ b/examples/mem_to_mem_idma2intr.c @@ -30,6 +30,8 @@ #include <common.h> #include <exports.h> +DECLARE_GLOBAL_DATA_PTR; + #define STANDALONE #ifndef STANDALONE /* Linked into/Part of PPCBoot */ @@ -346,8 +348,6 @@ static uint dpbase = 0; uint dpalloc (uint size, uint align) { - DECLARE_GLOBAL_DATA_PTR; - volatile immap_t *immr = (immap_t *) CFG_IMMR; uint retloc; uint align_mask, off; diff --git a/examples/smc91111_eeprom.c b/examples/smc91111_eeprom.c index 885f9336cd..98e3e86ffa 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 d4c6e063e3..1caa575747 100644 --- a/examples/stubs.c +++ b/examples/stubs.c @@ -92,7 +92,7 @@ gd_t *global_data; #x ":\n" \ " movhi r8, %%hi(%0)\n" \ " ori r8, r0, %%lo(%0)\n" \ -" add r8, r0, r15\n" \ +" add r8, r8, r15\n" \ " ldw r8, 0(r8)\n" \ " ldw r8, %1(r8)\n" \ " jmp r8\n" \ @@ -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 diff --git a/examples/timer.c b/examples/timer.c index 037fdfdb3a..13ec06f02c 100644 --- a/examples/timer.c +++ b/examples/timer.c @@ -26,6 +26,8 @@ #include <mpc8xx_irq.h> #include <exports.h> +DECLARE_GLOBAL_DATA_PTR; + #undef DEBUG #define TIMER_PERIOD 1000000 /* 1 second clock */ @@ -115,8 +117,6 @@ static char *usage = "\n[q, b, e, ?] "; int timer (int argc, char *argv[]) { - DECLARE_GLOBAL_DATA_PTR; - cpmtimer8xx_t *cpmtimerp; /* Pointer to the CPM Timer structure */ tid_8xx_cpmtimer_t hw; tid_8xx_cpmtimer_t *hwp = &hw; |