1 1.1 skrll /* $NetBSD: ingenic_coreregs.h,v 1.1 2017/05/21 06:49:13 skrll Exp $ */ 2 1.1 skrll 3 1.1 skrll /*- 4 1.1 skrll * Copyright (c) 2014 Michael Lorenz 5 1.1 skrll * All rights reserved. 6 1.1 skrll * 7 1.1 skrll * Redistribution and use in source and binary forms, with or without 8 1.1 skrll * modification, are permitted provided that the following conditions 9 1.1 skrll * are met: 10 1.1 skrll * 1. Redistributions of source code must retain the above copyright 11 1.1 skrll * notice, this list of conditions and the following disclaimer. 12 1.1 skrll * 2. Redistributions in binary form must reproduce the above copyright 13 1.1 skrll * notice, this list of conditions and the following disclaimer in the 14 1.1 skrll * documentation and/or other materials provided with the distribution. 15 1.1 skrll * 16 1.1 skrll * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 17 1.1 skrll * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 1.1 skrll * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 1.1 skrll * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 20 1.1 skrll * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 1.1 skrll * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 1.1 skrll * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 1.1 skrll * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 1.1 skrll * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 1.1 skrll * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 1.1 skrll * POSSIBILITY OF SUCH DAMAGE. 27 1.1 skrll */ 28 1.1 skrll 29 1.1 skrll #ifndef INGENIC_COREREGS_H 30 1.1 skrll #define INGENIC_COREREGS_H 31 1.1 skrll 32 1.1 skrll #ifdef _LOCORE 33 1.1 skrll #define _(n) __CONCAT($,n) 34 1.1 skrll #else 35 1.1 skrll #define _(n) n 36 1.1 skrll #endif 37 1.1 skrll 38 1.1 skrll /* cores status, 12 select 3 */ 39 1.1 skrll #define CP0_CORE_CTRL _(12), 2 /* select 2 */ 40 1.1 skrll #define CC_SW_RST0 __BIT(0) /* reset core 0 */ 41 1.1 skrll #define CC_SW_RST1 __BIT(1) /* reset core 1 */ 42 1.1 skrll #define CC_RPC0 __BIT(8) /* dedicated reset entry core 0 */ 43 1.1 skrll #define CC_RPC1 __BIT(9) /* -- || -- core 1 */ 44 1.1 skrll #define CC_SLEEP0M __BIT(16) /* mask sleep core 0 */ 45 1.1 skrll #define CC_SLEEP1M __BIT(17) /* mask sleep core 1 */ 46 1.1 skrll 47 1.1 skrll /* cores status, 12 select 3 */ 48 1.1 skrll #define CP0_CORE_STATUS _(12), 3 49 1.1 skrll #define CS_MIRQ0_P __BIT(0) /* mailbox IRQ for 0 pending */ 50 1.1 skrll #define CS_MIRQ1_P __BIT(1) /* || core 1 */ 51 1.1 skrll #define CS_IRQ0_P __BIT(8) /* peripheral IRQ for core 0 */ 52 1.1 skrll #define CS_IRQ1_P __BIT(9) /* || core 1 */ 53 1.1 skrll #define CS_SLEEP0 __BIT(16) /* core 0 sleeping */ 54 1.1 skrll #define CS_SLEEP1 __BIT(17) /* core 1 sleeping */ 55 1.1 skrll 56 1.1 skrll /* cores reset entry & IRQ masks - 12 select 4 */ 57 1.1 skrll #define CP0_CORE_REIM _(12), 4 58 1.1 skrll #define REIM_MIRQ0_M __BIT(0) /* allow mailbox IRQ for core 0 */ 59 1.1 skrll #define REIM_MIRQ1_M __BIT(1) /* allow mailbox IRQ for core 1 */ 60 1.1 skrll #define REIM_IRQ0_M __BIT(8) /* allow peripheral IRQ for core 0 */ 61 1.1 skrll #define REIM_IRQ1_M __BIT(9) /* allow peripheral IRQ for core 1 */ 62 1.1 skrll #define REIM_ENTRY_M __BITS(31,16) /* reset exception entry if RPCn=1 */ 63 1.1 skrll 64 1.1 skrll #define CP0_SPINLOCK _(12), 5 65 1.1 skrll #define CP0_SPINATOMIC _(12), 6 66 1.1 skrll 67 1.1 skrll #define CP0_CORE0_MBOX _(20), 0 68 1.1 skrll #define CP0_CORE1_MBOX _(20), 1 69 1.1 skrll 70 1.1 skrll #endif /* INGENIC_COREREGS_H */ 71