Lines Matching +full:address +full:- +full:bits
7 * Copyright (c) 2003-2017 Cavium, Inc.
14 * AS-IS and WITHOUT ANY WARRANTY; without even the implied warranty
21 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
56 #include <asm/octeon/cvmx-asm.h>
57 #include <asm/octeon/cvmx-packet.h>
58 #include <asm/octeon/cvmx-sysinfo.h>
60 #include <asm/octeon/cvmx-ciu-defs.h>
61 #include <asm/octeon/cvmx-ciu3-defs.h>
62 #include <asm/octeon/cvmx-gpio-defs.h>
63 #include <asm/octeon/cvmx-iob-defs.h>
64 #include <asm/octeon/cvmx-ipd-defs.h>
65 #include <asm/octeon/cvmx-l2c-defs.h>
66 #include <asm/octeon/cvmx-l2d-defs.h>
67 #include <asm/octeon/cvmx-l2t-defs.h>
68 #include <asm/octeon/cvmx-led-defs.h>
69 #include <asm/octeon/cvmx-mio-defs.h>
70 #include <asm/octeon/cvmx-pow-defs.h>
72 #include <asm/octeon/cvmx-bootinfo.h>
73 #include <asm/octeon/cvmx-bootmem.h>
74 #include <asm/octeon/cvmx-l2c.h>
88 #define CVMX_CACHE_LINE_MASK (CVMX_CACHE_LINE_SIZE - 1) /* In bytes */
95 * provided in the cvmx-app-init*.c files.
110 * Builds a bit mask given the required size in bits.
112 * @bits: Number of bits in the mask
114 */ static inline uint64_t cvmx_build_mask(uint64_t bits) in cvmx_build_mask() argument
116 return ~((~0x0ull) << bits); in cvmx_build_mask()
120 * Builds a memory address for I/O based on the Major and Sub DID.
124 * Returns I/O base address
140 * +-------+-------+-------+-------+-------+-------+-------+------+
144 * @high_bit: Highest bit value can occupy (inclusive) 0-63
145 * @low_bit: Lowest bit value can occupy inclusive 0-high_bit
152 return (value & cvmx_build_mask(high_bit - low_bit + 1)) << low_bit; in cvmx_build_bits()
157 * memory address (phys_addr_t). Octeon hardware widgets don't
161 * Returns Hardware physical address
168 * that we can use 40 bits of address space (the in cvmx_ptr_to_phys()
170 * were we need to limit this to 30 bits, sign in cvmx_ptr_to_phys()
171 * extended 32 bit. Although these are 64 bits wide, in cvmx_ptr_to_phys()
172 * only 30 bits can be used. in cvmx_ptr_to_phys()
184 * Convert a hardware physical address (uint64_t) into a
188 * Hardware physical address to memory
207 a full 64bit address. With a 64bit ABI, this can be done with a simple
210 /* We have a full 64bit ABI. Writing to a 64bit address can be done with
221 a full 64bit address. With a 64bit ABI, this can be done with a simple
224 /* We have a full 64bit ABI. Writing to a 64bit address can be done with
233 /* The following defines 8 functions for writing to a 64bit address. Each
234 takes two arguments, the address and the value to write.
249 /* The following defines 8 functions for reading from a 64bit address. Each
250 takes the address as the only argument
346 /* Maximum # of bits to define core in node */
358 return cvmx_get_core_num() & ((1 << CVMX_NODE_NO_SHIFT) - 1); in cvmx_get_local_core_num()
361 #define CVMX_NODE_BITS (2) /* Number of bits to define a node */
390 * Returns the number of bits set in the provided value.
393 * @val: 32 bit value to count set bits in
395 * Returns Number of bits set
405 * Returns the number of bits set in the provided value.
408 * @val: 64 bit value to count set bits in
410 * Returns Number of bits set
452 * 1) read csr at "address" with a csr typedef of "type"
456 #define CVMX_WAIT_FOR_FIELD64(address, type, field, op, value, timeout_usec)\ argument
462 cvmx_sysinfo_get()->cpu_clock_hz / 1000000; \
465 c.u64 = cvmx_read_csr(address); \
470 result = -1; \