diff options
author | Michal Simek <monstr@monstr.eu> | 2007-04-21 21:02:40 +0200 |
---|---|---|
committer | Michal Simek <monstr@monstr.eu> | 2007-04-21 21:02:40 +0200 |
commit | 0643631aa1036cd746bf5d15f5a34bc7bc01ea4f (patch) | |
tree | 4cf723e9fd6923b10c3b9495236215f84b2297ee /cpu/microblaze/start.S | |
parent | 9d1d6a34d26c5933bc097ce73c9348f95573cdd4 (diff) | |
download | u-boot-imx-0643631aa1036cd746bf5d15f5a34bc7bc01ea4f.zip u-boot-imx-0643631aa1036cd746bf5d15f5a34bc7bc01ea4f.tar.gz u-boot-imx-0643631aa1036cd746bf5d15f5a34bc7bc01ea4f.tar.bz2 |
16bit read/write little endian
Diffstat (limited to 'cpu/microblaze/start.S')
-rw-r--r-- | cpu/microblaze/start.S | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/cpu/microblaze/start.S b/cpu/microblaze/start.S index 29481af..4538158 100644 --- a/cpu/microblaze/start.S +++ b/cpu/microblaze/start.S @@ -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 |