diff options
author | Usama Arif <usama.arif@arm.com> | 2018-12-12 17:08:33 +0000 |
---|---|---|
committer | Usama Arif <usama.arif@arm.com> | 2019-02-19 17:07:48 +0000 |
commit | a5aa25af6514ff04721efce05e46b4daf8729a85 (patch) | |
tree | edfa3429fd232129a838c6043c84928ddff63c60 /drivers | |
parent | c9fe6fed4bcd930af4ccc487633b35e92d3cc288 (diff) | |
download | platform_external_arm-trusted-firmware-a5aa25af6514ff04721efce05e46b4daf8729a85.tar.gz platform_external_arm-trusted-firmware-a5aa25af6514ff04721efce05e46b4daf8729a85.tar.bz2 platform_external_arm-trusted-firmware-a5aa25af6514ff04721efce05e46b4daf8729a85.zip |
Division functionality for cores that dont have divide hardware.
Cortex a5 doesnt support hardware division such as sdiv and udiv commands.
This commit adds a software division function in assembly as well as include
appropriate files for software divison.
The software division algorithm is a modified version obtained from:
http://www.keil.com/support/man/docs/armasm/armasm_dom1359731155623.htm
Change-Id: Ib405a330da5f1cea1e68e07e7b520edeef9e2652
Signed-off-by: Usama Arif <usama.arif@arm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/arm/pl011/aarch32/pl011_console.S | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/arm/pl011/aarch32/pl011_console.S b/drivers/arm/pl011/aarch32/pl011_console.S index ae613b134..e9f95f289 100644 --- a/drivers/arm/pl011/aarch32/pl011_console.S +++ b/drivers/arm/pl011/aarch32/pl011_console.S @@ -63,7 +63,14 @@ func console_pl011_core_init /* Program the baudrate */ /* Divisor = (Uart clock * 4) / baudrate */ lsl r1, r1, #2 +#if (ARM_ARCH_MAJOR == 7) && !defined(ARMV7_SUPPORTS_VIRTUALIZATION) + push {r0,r3} + softudiv r0,r1,r2,r3 + mov r1, r0 + pop {r0,r3} +#else udiv r2, r1, r2 +#endif /* IBRD = Divisor >> 6 */ lsr r1, r2, #6 /* Write the IBRD */ |