15b3b1688SDavid Daney /*
25b3b1688SDavid Daney * This file is subject to the terms and conditions of the GNU General Public
35b3b1688SDavid Daney * License. See the file "COPYING" in the main directory of this archive
45b3b1688SDavid Daney * for more details.
55b3b1688SDavid Daney *
65b3b1688SDavid Daney * Copyright (C) 2004-2008 Cavium Networks
75b3b1688SDavid Daney */
85b3b1688SDavid Daney #ifndef __ASM_OCTEON_OCTEON_H
95b3b1688SDavid Daney #define __ASM_OCTEON_OCTEON_H
105b3b1688SDavid Daney
11a1ce3928SDavid Howells #include <asm/octeon/cvmx.h>
12664f1ae5SDavid Daney #include <asm/bitfield.h>
135b3b1688SDavid Daney
145b3b1688SDavid Daney extern uint64_t octeon_bootmem_alloc_range_phys(uint64_t size,
155b3b1688SDavid Daney uint64_t alignment,
165b3b1688SDavid Daney uint64_t min_addr,
175b3b1688SDavid Daney uint64_t max_addr,
185b3b1688SDavid Daney int do_locking);
195b3b1688SDavid Daney extern void *octeon_bootmem_alloc(uint64_t size, uint64_t alignment,
205b3b1688SDavid Daney int do_locking);
215b3b1688SDavid Daney extern void *octeon_bootmem_alloc_range(uint64_t size, uint64_t alignment,
225b3b1688SDavid Daney uint64_t min_addr, uint64_t max_addr,
235b3b1688SDavid Daney int do_locking);
245b3b1688SDavid Daney extern void *octeon_bootmem_alloc_named(uint64_t size, uint64_t alignment,
255b3b1688SDavid Daney char *name);
265b3b1688SDavid Daney extern void *octeon_bootmem_alloc_named_range(uint64_t size, uint64_t min_addr,
275b3b1688SDavid Daney uint64_t max_addr, uint64_t align,
285b3b1688SDavid Daney char *name);
295b3b1688SDavid Daney extern void *octeon_bootmem_alloc_named_address(uint64_t size, uint64_t address,
305b3b1688SDavid Daney char *name);
315b3b1688SDavid Daney extern int octeon_bootmem_free_named(char *name);
325b3b1688SDavid Daney extern void octeon_bootmem_lock(void);
335b3b1688SDavid Daney extern void octeon_bootmem_unlock(void);
345b3b1688SDavid Daney
355b3b1688SDavid Daney extern int octeon_is_simulation(void);
365b3b1688SDavid Daney extern int octeon_is_pci_host(void);
375b3b1688SDavid Daney extern int octeon_usb_is_ref_clk(void);
385b3b1688SDavid Daney extern uint64_t octeon_get_clock_rate(void);
39e195aa30SDavid Daney extern u64 octeon_get_io_clock_rate(void);
405b3b1688SDavid Daney extern const char *octeon_board_type_string(void);
415b3b1688SDavid Daney extern const char *octeon_get_pci_interrupts(void);
425b3b1688SDavid Daney extern int octeon_get_southbridge_interrupt(void);
435b3b1688SDavid Daney extern int octeon_get_boot_coremask(void);
445b3b1688SDavid Daney extern int octeon_get_boot_num_arguments(void);
455b3b1688SDavid Daney extern const char *octeon_get_boot_argument(int arg);
465b3b1688SDavid Daney extern void octeon_user_io_init(void);
475b3b1688SDavid Daney
485b3b1688SDavid Daney extern void octeon_init_cvmcount(void);
49ca148125SDavid Daney extern void octeon_setup_delays(void);
5070a26a21SDavid Daney extern void octeon_io_clk_delay(unsigned long);
515b3b1688SDavid Daney
525b3b1688SDavid Daney #define OCTEON_ARGV_MAX_ARGS 64
533becd97eSChristophe JAILLET #define OCTEON_SERIAL_LEN 20
545b3b1688SDavid Daney
555b3b1688SDavid Daney struct octeon_boot_descriptor {
56664f1ae5SDavid Daney #ifdef __BIG_ENDIAN_BITFIELD
575b3b1688SDavid Daney /* Start of block referenced by assembly code - do not change! */
585b3b1688SDavid Daney uint32_t desc_version;
595b3b1688SDavid Daney uint32_t desc_size;
605b3b1688SDavid Daney uint64_t stack_top;
615b3b1688SDavid Daney uint64_t heap_base;
625b3b1688SDavid Daney uint64_t heap_end;
635b3b1688SDavid Daney /* Only used by bootloader */
645b3b1688SDavid Daney uint64_t entry_point;
655b3b1688SDavid Daney uint64_t desc_vaddr;
665b3b1688SDavid Daney /* End of This block referenced by assembly code - do not change! */
675b3b1688SDavid Daney uint32_t exception_base_addr;
685b3b1688SDavid Daney uint32_t stack_size;
695b3b1688SDavid Daney uint32_t heap_size;
705b3b1688SDavid Daney /* Argc count for application. */
715b3b1688SDavid Daney uint32_t argc;
725b3b1688SDavid Daney uint32_t argv[OCTEON_ARGV_MAX_ARGS];
735b3b1688SDavid Daney
745b3b1688SDavid Daney #define BOOT_FLAG_INIT_CORE (1 << 0)
755b3b1688SDavid Daney #define OCTEON_BL_FLAG_DEBUG (1 << 1)
765b3b1688SDavid Daney #define OCTEON_BL_FLAG_NO_MAGIC (1 << 2)
775b3b1688SDavid Daney /* If set, use uart1 for console */
785b3b1688SDavid Daney #define OCTEON_BL_FLAG_CONSOLE_UART1 (1 << 3)
795b3b1688SDavid Daney /* If set, use PCI console */
805b3b1688SDavid Daney #define OCTEON_BL_FLAG_CONSOLE_PCI (1 << 4)
815b3b1688SDavid Daney /* Call exit on break on serial port */
825b3b1688SDavid Daney #define OCTEON_BL_FLAG_BREAK (1 << 5)
835b3b1688SDavid Daney
845b3b1688SDavid Daney uint32_t flags;
855b3b1688SDavid Daney uint32_t core_mask;
865b3b1688SDavid Daney /* DRAM size in megabyes. */
875b3b1688SDavid Daney uint32_t dram_size;
885b3b1688SDavid Daney /* physical address of free memory descriptor block. */
895b3b1688SDavid Daney uint32_t phy_mem_desc_addr;
905b3b1688SDavid Daney /* used to pass flags from app to debugger. */
915b3b1688SDavid Daney uint32_t debugger_flags_base_addr;
925b3b1688SDavid Daney /* CPU clock speed, in hz. */
935b3b1688SDavid Daney uint32_t eclock_hz;
945b3b1688SDavid Daney /* DRAM clock speed, in hz. */
955b3b1688SDavid Daney uint32_t dclock_hz;
965b3b1688SDavid Daney /* SPI4 clock in hz. */
975b3b1688SDavid Daney uint32_t spi_clock_hz;
985b3b1688SDavid Daney uint16_t board_type;
995b3b1688SDavid Daney uint8_t board_rev_major;
1005b3b1688SDavid Daney uint8_t board_rev_minor;
1015b3b1688SDavid Daney uint16_t chip_type;
1025b3b1688SDavid Daney uint8_t chip_rev_major;
1035b3b1688SDavid Daney uint8_t chip_rev_minor;
1043becd97eSChristophe JAILLET char board_serial_number[OCTEON_SERIAL_LEN];
1055b3b1688SDavid Daney uint8_t mac_addr_base[6];
1065b3b1688SDavid Daney uint8_t mac_addr_count;
1075b3b1688SDavid Daney uint64_t cvmx_desc_vaddr;
108664f1ae5SDavid Daney #else
109664f1ae5SDavid Daney uint32_t desc_size;
110664f1ae5SDavid Daney uint32_t desc_version;
111664f1ae5SDavid Daney uint64_t stack_top;
112664f1ae5SDavid Daney uint64_t heap_base;
113664f1ae5SDavid Daney uint64_t heap_end;
114664f1ae5SDavid Daney /* Only used by bootloader */
115664f1ae5SDavid Daney uint64_t entry_point;
116664f1ae5SDavid Daney uint64_t desc_vaddr;
117664f1ae5SDavid Daney /* End of This block referenced by assembly code - do not change! */
118664f1ae5SDavid Daney uint32_t stack_size;
119664f1ae5SDavid Daney uint32_t exception_base_addr;
120664f1ae5SDavid Daney uint32_t argc;
121664f1ae5SDavid Daney uint32_t heap_size;
122664f1ae5SDavid Daney /*
123664f1ae5SDavid Daney * Argc count for application.
124664f1ae5SDavid Daney * Warning low bit scrambled in little-endian.
125664f1ae5SDavid Daney */
126664f1ae5SDavid Daney uint32_t argv[OCTEON_ARGV_MAX_ARGS];
127664f1ae5SDavid Daney
128664f1ae5SDavid Daney #define BOOT_FLAG_INIT_CORE (1 << 0)
129664f1ae5SDavid Daney #define OCTEON_BL_FLAG_DEBUG (1 << 1)
130664f1ae5SDavid Daney #define OCTEON_BL_FLAG_NO_MAGIC (1 << 2)
131664f1ae5SDavid Daney /* If set, use uart1 for console */
132664f1ae5SDavid Daney #define OCTEON_BL_FLAG_CONSOLE_UART1 (1 << 3)
133664f1ae5SDavid Daney /* If set, use PCI console */
134664f1ae5SDavid Daney #define OCTEON_BL_FLAG_CONSOLE_PCI (1 << 4)
135664f1ae5SDavid Daney /* Call exit on break on serial port */
136664f1ae5SDavid Daney #define OCTEON_BL_FLAG_BREAK (1 << 5)
137664f1ae5SDavid Daney
138664f1ae5SDavid Daney uint32_t core_mask;
139664f1ae5SDavid Daney uint32_t flags;
140664f1ae5SDavid Daney /* physical address of free memory descriptor block. */
141664f1ae5SDavid Daney uint32_t phy_mem_desc_addr;
142664f1ae5SDavid Daney /* DRAM size in megabyes. */
143664f1ae5SDavid Daney uint32_t dram_size;
144664f1ae5SDavid Daney /* CPU clock speed, in hz. */
145664f1ae5SDavid Daney uint32_t eclock_hz;
146664f1ae5SDavid Daney /* used to pass flags from app to debugger. */
147664f1ae5SDavid Daney uint32_t debugger_flags_base_addr;
148664f1ae5SDavid Daney /* SPI4 clock in hz. */
149664f1ae5SDavid Daney uint32_t spi_clock_hz;
150664f1ae5SDavid Daney /* DRAM clock speed, in hz. */
151664f1ae5SDavid Daney uint32_t dclock_hz;
152664f1ae5SDavid Daney uint8_t chip_rev_minor;
153664f1ae5SDavid Daney uint8_t chip_rev_major;
154664f1ae5SDavid Daney uint16_t chip_type;
155664f1ae5SDavid Daney uint8_t board_rev_minor;
156664f1ae5SDavid Daney uint8_t board_rev_major;
157664f1ae5SDavid Daney uint16_t board_type;
158664f1ae5SDavid Daney
159664f1ae5SDavid Daney uint64_t unused1[4]; /* Not even filled in by bootloader. */
160664f1ae5SDavid Daney
161664f1ae5SDavid Daney uint64_t cvmx_desc_vaddr;
162664f1ae5SDavid Daney #endif
1635b3b1688SDavid Daney };
1645b3b1688SDavid Daney
1655b3b1688SDavid Daney union octeon_cvmemctl {
1665b3b1688SDavid Daney uint64_t u64;
1675b3b1688SDavid Daney struct {
1685b3b1688SDavid Daney /* RO 1 = BIST fail, 0 = BIST pass */
169664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t tlbbist:1,
1705b3b1688SDavid Daney /* RO 1 = BIST fail, 0 = BIST pass */
171664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t l1cbist:1,
1725b3b1688SDavid Daney /* RO 1 = BIST fail, 0 = BIST pass */
173664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t l1dbist:1,
1745b3b1688SDavid Daney /* RO 1 = BIST fail, 0 = BIST pass */
175664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t dcmbist:1,
1765b3b1688SDavid Daney /* RO 1 = BIST fail, 0 = BIST pass */
177664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t ptgbist:1,
1785b3b1688SDavid Daney /* RO 1 = BIST fail, 0 = BIST pass */
179664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t wbfbist:1,
1805b3b1688SDavid Daney /* Reserved */
181664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t reserved:17,
182664f1ae5SDavid Daney /* OCTEON II - TLB replacement policy: 0 = bitmask LRU; 1 = NLU.
183664f1ae5SDavid Daney * This field selects between the TLB replacement policies:
184664f1ae5SDavid Daney * bitmask LRU or NLU. Bitmask LRU maintains a mask of
185664f1ae5SDavid Daney * recently used TLB entries and avoids them as new entries
186664f1ae5SDavid Daney * are allocated. NLU simply guarantees that the next
187664f1ae5SDavid Daney * allocation is not the last used TLB entry. */
188664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t tlbnlu:1,
189664f1ae5SDavid Daney /* OCTEON II - Selects the bit in the counter used for
190664f1ae5SDavid Daney * releasing a PAUSE. This counter trips every 2(8+PAUSETIME)
191664f1ae5SDavid Daney * cycles. If not already released, the cnMIPS II core will
192664f1ae5SDavid Daney * always release a given PAUSE instruction within
193664f1ae5SDavid Daney * 2(8+PAUSETIME). If the counter trip happens to line up,
194664f1ae5SDavid Daney * the cnMIPS II core may release the PAUSE instantly. */
195664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t pausetime:3,
196664f1ae5SDavid Daney /* OCTEON II - This field is an extension of
197664f1ae5SDavid Daney * CvmMemCtl[DIDTTO] */
198664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t didtto2:1,
1995b3b1688SDavid Daney /* R/W If set, marked write-buffer entries time out
200*0bfdf92aSRandy Dunlap * the same as other entries; if clear, marked
2015b3b1688SDavid Daney * write-buffer entries use the maximum timeout. */
202664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t dismarkwblongto:1,
2035b3b1688SDavid Daney /* R/W If set, a merged store does not clear the
2045b3b1688SDavid Daney * write-buffer entry timeout state. */
205664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t dismrgclrwbto:1,
2065b3b1688SDavid Daney /* R/W Two bits that are the MSBs of the resultant
2075b3b1688SDavid Daney * CVMSEG LM word location for an IOBDMA. The other 8
2085b3b1688SDavid Daney * bits come from the SCRADDR field of the IOBDMA. */
209664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t iobdmascrmsb:2,
2105b3b1688SDavid Daney /* R/W If set, SYNCWS and SYNCS only order marked
2115b3b1688SDavid Daney * stores; if clear, SYNCWS and SYNCS only order
2125b3b1688SDavid Daney * unmarked stores. SYNCWSMARKED has no effect when
2135b3b1688SDavid Daney * DISSYNCWS is set. */
214664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t syncwsmarked:1,
2155b3b1688SDavid Daney /* R/W If set, SYNCWS acts as SYNCW and SYNCS acts as
2165b3b1688SDavid Daney * SYNC. */
217664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t dissyncws:1,
2185b3b1688SDavid Daney /* R/W If set, no stall happens on write buffer
2195b3b1688SDavid Daney * full. */
220664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t diswbfst:1,
2215b3b1688SDavid Daney /* R/W If set (and SX set), supervisor-level
2225b3b1688SDavid Daney * loads/stores can use XKPHYS addresses with
2235b3b1688SDavid Daney * VA<48>==0 */
224664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t xkmemenas:1,
2255b3b1688SDavid Daney /* R/W If set (and UX set), user-level loads/stores
2265b3b1688SDavid Daney * can use XKPHYS addresses with VA<48>==0 */
227664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t xkmemenau:1,
2285b3b1688SDavid Daney /* R/W If set (and SX set), supervisor-level
2295b3b1688SDavid Daney * loads/stores can use XKPHYS addresses with
2305b3b1688SDavid Daney * VA<48>==1 */
231664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t xkioenas:1,
2325b3b1688SDavid Daney /* R/W If set (and UX set), user-level loads/stores
2335b3b1688SDavid Daney * can use XKPHYS addresses with VA<48>==1 */
234664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t xkioenau:1,
2355b3b1688SDavid Daney /* R/W If set, all stores act as SYNCW (NOMERGE must
2365b3b1688SDavid Daney * be set when this is set) RW, reset to 0. */
237664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t allsyncw:1,
2385b3b1688SDavid Daney /* R/W If set, no stores merge, and all stores reach
2395b3b1688SDavid Daney * the coherent bus in order. */
240664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t nomerge:1,
2415b3b1688SDavid Daney /* R/W Selects the bit in the counter used for DID
2425b3b1688SDavid Daney * time-outs 0 = 231, 1 = 230, 2 = 229, 3 =
2435b3b1688SDavid Daney * 214. Actual time-out is between 1x and 2x this
2445b3b1688SDavid Daney * interval. For example, with DIDTTO=3, expiration
2455b3b1688SDavid Daney * interval is between 16K and 32K. */
246664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t didtto:2,
2475b3b1688SDavid Daney /* R/W If set, the (mem) CSR clock never turns off. */
248664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t csrckalwys:1,
2495b3b1688SDavid Daney /* R/W If set, mclk never turns off. */
250664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t mclkalwys:1,
2515b3b1688SDavid Daney /* R/W Selects the bit in the counter used for write
2525b3b1688SDavid Daney * buffer flush time-outs (WBFLT+11) is the bit
2535b3b1688SDavid Daney * position in an internal counter used to determine
2545b3b1688SDavid Daney * expiration. The write buffer expires between 1x and
2555b3b1688SDavid Daney * 2x this interval. For example, with WBFLT = 0, a
2565b3b1688SDavid Daney * write buffer expires between 2K and 4K cycles after
2575b3b1688SDavid Daney * the write buffer entry is allocated. */
258664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t wbfltime:3,
2595b3b1688SDavid Daney /* R/W If set, do not put Istream in the L2 cache. */
260664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t istrnol2:1,
2615b3b1688SDavid Daney /* R/W The write buffer threshold. */
262664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t wbthresh:4,
2635b3b1688SDavid Daney /* Reserved */
264664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t reserved2:2,
2655b3b1688SDavid Daney /* R/W If set, CVMSEG is available for loads/stores in
2665b3b1688SDavid Daney * kernel/debug mode. */
267664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t cvmsegenak:1,
2685b3b1688SDavid Daney /* R/W If set, CVMSEG is available for loads/stores in
2695b3b1688SDavid Daney * supervisor mode. */
270664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t cvmsegenas:1,
2715b3b1688SDavid Daney /* R/W If set, CVMSEG is available for loads/stores in
2725b3b1688SDavid Daney * user mode. */
273664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t cvmsegenau:1,
2745b3b1688SDavid Daney /* R/W Size of local memory in cache blocks, 54 (6912
2755b3b1688SDavid Daney * bytes) is max legal value. */
276664f1ae5SDavid Daney __BITFIELD_FIELD(uint64_t lmemsz:6,
277664f1ae5SDavid Daney ;)))))))))))))))))))))))))))))))))
2785b3b1688SDavid Daney } s;
2795b3b1688SDavid Daney };
2805b3b1688SDavid Daney
2815b3b1688SDavid Daney extern void octeon_check_cpu_bist(void);
2825b3b1688SDavid Daney
283840267e4SSteven J. Hill int octeon_prune_device_tree(void);
284840267e4SSteven J. Hill extern const char __dtb_octeon_3xxx_begin;
285840267e4SSteven J. Hill extern const char __dtb_octeon_68xx_begin;
2865b3b1688SDavid Daney
2875b3b1688SDavid Daney /**
2885b3b1688SDavid Daney * Write a 32bit value to the Octeon NPI register space
2895b3b1688SDavid Daney *
2905b3b1688SDavid Daney * @address: Address to write to
2915b3b1688SDavid Daney * @val: Value to write
2925b3b1688SDavid Daney */
octeon_npi_write32(uint64_t address,uint32_t val)2935b3b1688SDavid Daney static inline void octeon_npi_write32(uint64_t address, uint32_t val)
2945b3b1688SDavid Daney {
2955b3b1688SDavid Daney cvmx_write64_uint32(address ^ 4, val);
2965b3b1688SDavid Daney cvmx_read64_uint32(address ^ 4);
2975b3b1688SDavid Daney }
2985b3b1688SDavid Daney
299c6d2b22eSDavid Daney #ifdef CONFIG_SMP
300c6d2b22eSDavid Daney void octeon_setup_smp(void);
301c6d2b22eSDavid Daney #else
octeon_setup_smp(void)302c6d2b22eSDavid Daney static inline void octeon_setup_smp(void) {}
303c6d2b22eSDavid Daney #endif
304c6d2b22eSDavid Daney
305ce210d35SDavid Daney struct irq_domain;
306ce210d35SDavid Daney struct device_node;
307ce210d35SDavid Daney struct irq_data;
308ce210d35SDavid Daney struct irq_chip;
309ce210d35SDavid Daney void octeon_ciu3_mbox_send(int cpu, unsigned int mbox);
310ce210d35SDavid Daney int octeon_irq_ciu3_xlat(struct irq_domain *d,
311ce210d35SDavid Daney struct device_node *node,
312ce210d35SDavid Daney const u32 *intspec,
313ce210d35SDavid Daney unsigned int intsize,
314ce210d35SDavid Daney unsigned long *out_hwirq,
315ce210d35SDavid Daney unsigned int *out_type);
316ce210d35SDavid Daney void octeon_irq_ciu3_enable(struct irq_data *data);
317ce210d35SDavid Daney void octeon_irq_ciu3_disable(struct irq_data *data);
318ce210d35SDavid Daney void octeon_irq_ciu3_ack(struct irq_data *data);
319ce210d35SDavid Daney void octeon_irq_ciu3_mask(struct irq_data *data);
320ce210d35SDavid Daney void octeon_irq_ciu3_mask_ack(struct irq_data *data);
321ce210d35SDavid Daney int octeon_irq_ciu3_mapx(struct irq_domain *d, unsigned int virq,
322ce210d35SDavid Daney irq_hw_number_t hw, struct irq_chip *chip);
323ce210d35SDavid Daney
324ac655fb7SDavid Daney /* Octeon multiplier save/restore routines from octeon_switch.S */
325ac655fb7SDavid Daney void octeon_mult_save(void);
326ac655fb7SDavid Daney void octeon_mult_restore(void);
327ac655fb7SDavid Daney void octeon_mult_save_end(void);
328ac655fb7SDavid Daney void octeon_mult_restore_end(void);
329ac655fb7SDavid Daney void octeon_mult_save3(void);
330ac655fb7SDavid Daney void octeon_mult_save3_end(void);
331ac655fb7SDavid Daney void octeon_mult_save2(void);
332ac655fb7SDavid Daney void octeon_mult_save2_end(void);
333ac655fb7SDavid Daney void octeon_mult_restore3(void);
334ac655fb7SDavid Daney void octeon_mult_restore3_end(void);
335ac655fb7SDavid Daney void octeon_mult_restore2(void);
336ac655fb7SDavid Daney void octeon_mult_restore2_end(void);
3375b3b1688SDavid Daney
3385b3b1688SDavid Daney /**
3395b3b1688SDavid Daney * Read a 32bit value from the Octeon NPI register space
3405b3b1688SDavid Daney *
3415b3b1688SDavid Daney * @address: Address to read
3425b3b1688SDavid Daney * Returns The result
3435b3b1688SDavid Daney */
octeon_npi_read32(uint64_t address)3445b3b1688SDavid Daney static inline uint32_t octeon_npi_read32(uint64_t address)
3455b3b1688SDavid Daney {
3465b3b1688SDavid Daney return cvmx_read64_uint32(address ^ 4);
3475b3b1688SDavid Daney }
3485b3b1688SDavid Daney
349e8635b48SDavid Daney extern struct cvmx_bootinfo *octeon_bootinfo;
350e8635b48SDavid Daney
351babba4f1SDavid Daney extern uint64_t octeon_bootloader_entry_addr;
352babba4f1SDavid Daney
3530c326387SDavid Daney extern void (*octeon_irq_setup_secondary)(void);
3540c326387SDavid Daney
35588fd8589SDavid Daney typedef void (*octeon_irq_ip4_handler_t)(void);
35688fd8589SDavid Daney void octeon_irq_set_ip4_handler(octeon_irq_ip4_handler_t);
35788fd8589SDavid Daney
35817efb59aSRalf Baechle extern void octeon_fixup_irqs(void);
35917efb59aSRalf Baechle
36024d4e7f6SDavid Daney extern struct semaphore octeon_bootbus_sem;
36124d4e7f6SDavid Daney
362ba1fc934SSteven J. Hill struct irq_domain *octeon_irq_get_block_domain(int node, uint8_t block);
363ba1fc934SSteven J. Hill
3645b3b1688SDavid Daney #endif /* __ASM_OCTEON_OCTEON_H */
365