riscv: Avoid io read/write cause wrong result

io read/write may cause wrong result because they may read/write data
from/to register instead of memory. Add 'volatile' to avoid it.

Signed-off-by: Nick Hu <nick.hu@sifive.com>
Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
43 jobs for master in 58 minutes and 54 seconds (queued for 7 seconds)
Status Name Job ID Coverage
  Testsuites
passed Build envtools #338094

00:00:10

passed Build tools-only #338093

00:00:10

passed Check for configs without MAINTAINERS entry #338092

00:00:08

passed cppcheck #338088

00:00:19

passed grep TODO/FIXME/HACK #338089

00:00:15

passed htmldocs #338090

00:01:16

passed Run binman, buildman, dtoc, Kconfig and patman testsuites #338095

00:00:48

passed Run tests for Nokia RX-51 (aka N900) #338096

00:03:39

passed sloccount #338091

00:00:37

 
  Test.Py
passed evb-ast2500 test.py #338101

00:00:36

passed integratorcp_cm926ejs test.py #338104

00:00:36

passed qemu_arm64 test.py #338106

00:01:12

passed qemu_arm test.py #338105

00:01:15

passed qemu_malta64el test.py #338110

00:00:32

passed qemu_malta64 test.py #338109

00:00:32

passed qemu_maltael test.py #338108

00:00:31

passed qemu_malta test.py #338107

00:00:31

passed qemu-ppce500 test.py #338111

00:01:18

passed qemu-riscv32_spl test.py #338114

00:00:36

passed qemu-riscv32 test.py #338112

00:01:13

passed qemu-riscv64_spl test.py #338115

00:01:32

passed qemu-riscv64 test.py #338113

00:00:53

passed qemu-x86_64 test.py #338117

00:01:06

passed qemu-x86 test.py #338116

00:01:28

passed r2dplus_i82557c test.py #338118

00:00:52

passed r2dplus_pcnet test.py #338119

00:01:14

passed r2dplus_rtl8139 test.py #338120

00:00:32

passed r2dplus_tulip test.py #338121

00:01:50

passed sandbox_flattree test.py #338102

00:00:46

passed sandbox_noinst_test.py #338100

00:00:43

passed sandbox_spl test.py #338099

00:00:43

passed sandbox test.py #338097

00:08:27

passed sandbox with clang test.py #338098

00:08:14

passed sifive_unleashed_sdcard test.py #338122

00:02:17

passed sifive_unleashed_spi-nor test.py #338123

00:01:28

passed vexpress_ca9x4 test.py #338103

00:00:33

passed xilinx_versal_virt test.py #338125

00:01:20

passed xilinx_zynq_virt test.py #338124

00:00:41

passed xtfpga test.py #338126

00:00:50

 
  World Build
passed build all 32bit ARM platforms #338127

00:39:03

passed build all 64bit ARM platforms #338128

00:17:11

passed build all other platforms #338130

00:02:51

passed build all PowerPC platforms #338129

00:02:22