diff options
author | Aaro Koskinen <aaro.koskinen@nsn.com> | 2014-09-08 11:25:40 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2014-11-24 01:45:32 -0500 |
commit | 0f24017a108e7fd4319143bfd0968d5cd026f33d (patch) | |
tree | 0358d36ea75467b5d01c59f744217291e14241e1 /arch/mips | |
parent | 569309b42fc67a8b42f57adb68764bd10bcf2178 (diff) |
MIPS: Octeon: Move cvmx_fuse_read_byte()
Move cvmx_fuse_read_byte() into a .c file.
Signed-off-by: Aaro Koskinen <aaro.koskinen@nsn.com>
Cc: David Daney <david.daney@cavium.com>
Cc: linux-mips@linux-mips.org
Cc: Aaro Koskinen <aaro.koskinen@nsn.com>
Patchwork: https://patchwork.linux-mips.org/patch/7666/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/cavium-octeon/executive/octeon-model.c | 20 | ||||
-rw-r--r-- | arch/mips/include/asm/octeon/cvmx.h | 20 |
2 files changed, 21 insertions, 19 deletions
diff --git a/arch/mips/cavium-octeon/executive/octeon-model.c b/arch/mips/cavium-octeon/executive/octeon-model.c index f4c1b36fdf65..e1878723efd8 100644 --- a/arch/mips/cavium-octeon/executive/octeon-model.c +++ b/arch/mips/cavium-octeon/executive/octeon-model.c | |||
@@ -28,6 +28,26 @@ | |||
28 | #include <asm/octeon/octeon.h> | 28 | #include <asm/octeon/octeon.h> |
29 | 29 | ||
30 | /** | 30 | /** |
31 | * Read a byte of fuse data | ||
32 | * @byte_addr: address to read | ||
33 | * | ||
34 | * Returns fuse value: 0 or 1 | ||
35 | */ | ||
36 | uint8_t cvmx_fuse_read_byte(int byte_addr) | ||
37 | { | ||
38 | union cvmx_mio_fus_rcmd read_cmd; | ||
39 | |||
40 | read_cmd.u64 = 0; | ||
41 | read_cmd.s.addr = byte_addr; | ||
42 | read_cmd.s.pend = 1; | ||
43 | cvmx_write_csr(CVMX_MIO_FUS_RCMD, read_cmd.u64); | ||
44 | while ((read_cmd.u64 = cvmx_read_csr(CVMX_MIO_FUS_RCMD)) | ||
45 | && read_cmd.s.pend) | ||
46 | ; | ||
47 | return read_cmd.s.dat; | ||
48 | } | ||
49 | |||
50 | /** | ||
31 | * Given the chip processor ID from COP0, this function returns a | 51 | * Given the chip processor ID from COP0, this function returns a |
32 | * string representing the chip model number. The string is of the | 52 | * string representing the chip model number. The string is of the |
33 | * form CNXXXXpX.X-FREQ-SUFFIX. | 53 | * form CNXXXXpX.X-FREQ-SUFFIX. |
diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h index f991e7701d3d..6852dfa50010 100644 --- a/arch/mips/include/asm/octeon/cvmx.h +++ b/arch/mips/include/asm/octeon/cvmx.h | |||
@@ -451,25 +451,7 @@ static inline uint32_t cvmx_octeon_num_cores(void) | |||
451 | return cvmx_pop(ciu_fuse); | 451 | return cvmx_pop(ciu_fuse); |
452 | } | 452 | } |
453 | 453 | ||
454 | /** | 454 | uint8_t cvmx_fuse_read_byte(int byte_addr); |
455 | * Read a byte of fuse data | ||
456 | * @byte_addr: address to read | ||
457 | * | ||
458 | * Returns fuse value: 0 or 1 | ||
459 | */ | ||
460 | static uint8_t cvmx_fuse_read_byte(int byte_addr) | ||
461 | { | ||
462 | union cvmx_mio_fus_rcmd read_cmd; | ||
463 | |||
464 | read_cmd.u64 = 0; | ||
465 | read_cmd.s.addr = byte_addr; | ||
466 | read_cmd.s.pend = 1; | ||
467 | cvmx_write_csr(CVMX_MIO_FUS_RCMD, read_cmd.u64); | ||
468 | while ((read_cmd.u64 = cvmx_read_csr(CVMX_MIO_FUS_RCMD)) | ||
469 | && read_cmd.s.pend) | ||
470 | ; | ||
471 | return read_cmd.s.dat; | ||
472 | } | ||
473 | 455 | ||
474 | /** | 456 | /** |
475 | * Read a single fuse bit | 457 | * Read a single fuse bit |