diff options
author | Mario Six <mario.six@gdsys.cc> | 2019-01-21 09:18:21 +0100 |
---|---|---|
committer | Mario Six <mario.six@gdsys.cc> | 2019-05-21 07:52:34 +0200 |
commit | 5c2299850390b31d3262893b407bd26572f04c4e (patch) | |
tree | d8a0c4b9a19e03dc791e6949e3f8cda0abb78778 /arch/powerpc/cpu/mpc83xx/ecc.c | |
parent | 1e718f43de1bee73fe727597101865f81ff873f5 (diff) | |
download | u-boot-5c2299850390b31d3262893b407bd26572f04c4e.tar.gz |
mpc83xx: Use pre-defined asm functions
For a lot of inline assembly calls in the mpc8xxx and mpc83xx
directories, we already have convenient pre-defined helper functions,
but they're not used, resulting in hard-to-read code.
Use these helper functions where ever possible and useful.
Signed-off-by: Mario Six <mario.six@gdsys.cc>
Diffstat (limited to 'arch/powerpc/cpu/mpc83xx/ecc.c')
-rw-r--r-- | arch/powerpc/cpu/mpc83xx/ecc.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/arch/powerpc/cpu/mpc83xx/ecc.c b/arch/powerpc/cpu/mpc83xx/ecc.c index 73f0be2a30..10e9b96add 100644 --- a/arch/powerpc/cpu/mpc83xx/ecc.c +++ b/arch/powerpc/cpu/mpc83xx/ecc.c @@ -191,8 +191,8 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) } ddr->err_disable = val; - __asm__ __volatile__("sync"); - __asm__ __volatile__("isync"); + sync(); + isync(); return 0; } else if (strcmp(argv[1], "errdetectclr") == 0) { val = ddr->err_detect; @@ -249,8 +249,8 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) printf("Incorrect command\n"); ddr->ecc_err_inject = val; - __asm__ __volatile__("sync"); - __asm__ __volatile__("isync"); + sync(); + isync(); return 0; } else if (strcmp(argv[1], "mirror") == 0) { val = ddr->ecc_err_inject; @@ -282,26 +282,26 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) /* enable injects */ ddr->ecc_err_inject |= ECC_ERR_INJECT_EIEN; - __asm__ __volatile__("sync"); - __asm__ __volatile__("isync"); + sync(); + isync(); /* write memory location injecting errors */ ppcDWstore((u32 *) i, pattern); - __asm__ __volatile__("sync"); + sync(); /* disable injects */ ddr->ecc_err_inject &= ~ECC_ERR_INJECT_EIEN; - __asm__ __volatile__("sync"); - __asm__ __volatile__("isync"); + sync(); + isync(); /* read data, this generates ECC error */ ppcDWload((u32 *) i, ret); - __asm__ __volatile__("sync"); + sync(); /* re-initialize memory, double word write the location again, * generates new ECC code this time */ ppcDWstore((u32 *) i, writeback); - __asm__ __volatile__("sync"); + sync(); } enable_interrupts(); return 0; @@ -321,29 +321,29 @@ int do_ecc(cmd_tbl_t * cmdtp, int flag, int argc, char * const argv[]) /* enable injects */ ddr->ecc_err_inject |= ECC_ERR_INJECT_EIEN; - __asm__ __volatile__("sync"); - __asm__ __volatile__("isync"); + sync(); + isync(); /* write memory location injecting errors */ *(u32 *) i = 0xfedcba98UL; - __asm__ __volatile__("sync"); + sync(); /* sub double word write, * bus will read-modify-write, * generates ECC error */ *((u32 *) i + 1) = 0x76543210UL; - __asm__ __volatile__("sync"); + sync(); /* disable injects */ ddr->ecc_err_inject &= ~ECC_ERR_INJECT_EIEN; - __asm__ __volatile__("sync"); - __asm__ __volatile__("isync"); + sync(); + isync(); /* re-initialize memory, * double word write the location again, * generates new ECC code this time */ ppcDWstore((u32 *) i, writeback); - __asm__ __volatile__("sync"); + sync(); } enable_interrupts(); return 0; |