[PATCH 2/2] Initial bsp for Tiny6410

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Apr 19 07:46:30 UTC 2013


On 04/18/2013 06:50 PM, Gedare Bloom wrote:
> The previous version indicated you copied code from other parts of
> RTEMS. If you retained the copied code, you should also retain the
> code's copyright notice and add your own copyright if you made
> changes.

The best way would be to not copy code at all and use a common file.  We have 
for example this:

--- ../../arm/smdk2410/startup/bspreset.c	2012-07-17 15:01:17.784193073 +0200
+++ ../../arm/tiny6410/startup/bspreset.c	2013-04-17 16:39:27.860189978 +0200
@@ -1,5 +1,7 @@
  /*
- *  Copyright (c) 2002 by Jay Monkman <jtm at smoothsmoothie.com>
+ *  Bsp Reset
+ *
+ *  Copyright (c) 2013 by PengFan <van.freenix at gmail.com>
   *
   *  The license and distribution terms for this file may be
   *  found in the file LICENSE in this distribution or at
@@ -10,15 +12,10 @@

  void bsp_reset(void)
  {
-#if ON_SKYEYE == 1
-  #define SKYEYE_MAGIC_ADDRESS (*(volatile unsigned int *)(0xb0000000))
-
-  SKYEYE_MAGIC_ADDRESS = 0xff;
-#else
-  /* XXX TODO this code is copied from gp32.. move it to a shared place */
    rtems_interrupt_level level;
    rtems_interrupt_disable(level);
-  /* disable mmu, invalide i-cache and call swi #4 */
+  /* disable mmu, invalide i-cache, clean and invalidate d-cache
+	 * and mov pc to 0 */
    __asm__ volatile(""
      "mrc    p15,0,r0,c1,c0,0  \n"
      "bic    r0,r0,#1          \n"
@@ -35,11 +32,17 @@
      "nop                      \n"
      "nop                      \n"
      "nop                      \n"
-    "swi    #4                "
+    "mov    r0,#0             \n"
+    "MCR    p15,0,r0,c7,c14,0 \n"
+    "nop                      \n"
+    "nop                      \n"
+    "nop                      \n"
+    "nop                      \n"
+    "nop                      \n"
+    "ldr	pc,					=0x0"
      :
      :
      : "r0"
    );
    /* we should be back in bios now */
-#endif
  }

Why do we need two different files if we only use the CP15 and no chip specific 
features like a watchdog module?

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the devel mailing list