]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
16bit read/write little endian
authorMichal Simek <monstr@monstr.eu>
Sat, 21 Apr 2007 19:02:40 +0000 (21:02 +0200)
committerMichal Simek <monstr@monstr.eu>
Sat, 21 Apr 2007 19:02:40 +0000 (21:02 +0200)
cpu/microblaze/start.S
include/common.h

index 29481af9ae9cf625e3882d57ea71ffbb6327301b..453815818d099e306fc57a414ff100fe936c5603 100644 (file)
@@ -117,3 +117,36 @@ clear_bss:
 3:     /* jumping to board_init */
        brai    board_init
 1:     bri     1b
+
+/*
+ * Read 16bit little endian
+ */
+       .text
+       .global in16
+       .ent    in16
+       .align  2
+in16:  lhu     r3, r0, r5
+       bslli   r4, r3, 8
+       bsrli   r3, r3, 8
+       andi    r4, r4, 0xffff
+       or      r3, r3, r4
+       rtsd    r15, 8
+       sext16  r3, r3
+       .end    in16
+
+/*
+ * Write 16bit little endian
+ * first parameter(r5) - address, second(r6) - short value
+ */
+       .text
+       .global out16
+       .ent    out16
+       .align  2
+out16: bslli   r3, r6, 8
+       bsrli   r6, r6, 8
+       andi    r3, r3, 0xffff
+       or      r3, r3, r6
+       sh      r3, r0, r5
+       rtsd    r15, 8
+       or      r0, r0, r0
+       .end    out16
index b162dbd7cfc421592dc3cf4afa37f5930113d36d..40fbba5325ff773c24cf980bf9bbe9baf89a5d6b 100644 (file)
@@ -402,6 +402,10 @@ void               ppcDcbi(unsigned long value);
 void           ppcSync(void);
 void           ppcDcbz(unsigned long value);
 #endif
+#if defined (CONFIG_MICROBLAZE)
+unsigned short in16(unsigned int);
+void           out16(unsigned int, unsigned short value);
+#endif
 
 #if defined (CONFIG_MPC83XX)
 void           ppcDWload(unsigned int *addr, unsigned int *ret);