Contiki 3.x
imr.h
1 /*
2  * Copyright (C) 2015-2016, Intel Corporation. All rights reserved.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  * 1. Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * 2. Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  *
13  * 3. Neither the name of the copyright holder nor the names of its
14  * contributors may be used to endorse or promote products derived
15  * from this software without specific prior written permission.
16  *
17  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
20  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
21  * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
22  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
23  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
28  * OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef CPU_X86_DRIVERS_QUARKX1000_IMR_H_
32 #define CPU_X86_DRIVERS_QUARKX1000_IMR_H_
33 
34 #include <stdint.h>
35 
36 typedef union quarkX1000_imr_lo {
37  struct {
38  uint32_t : 2;
39  uint32_t addr : 22;
40  uint32_t : 7;
41  uint32_t lock : 1;
42  };
43  uint32_t raw;
44 } quarkX1000_imr_lo_t;
45 
46 typedef union quarkX1000_imr_hi {
47  struct {
48  uint32_t : 2;
49  uint32_t addr : 22;
50  uint32_t : 8;
51  };
52  uint32_t raw;
53 } quarkX1000_imr_hi_t;
54 
55 /* Amount to shift imr_lo/hi.addr left to obtain the bound address */
56 #define QUARKX1000_IMR_SHAMT 10
57 
58 typedef union quarkX1000_imr_rdmsk {
59  struct {
60  uint32_t cpu0 : 1;
61  uint32_t cpu_0 : 1;
62  uint32_t : 6;
63  uint32_t vc0_sai_id0 : 1;
64  uint32_t vc0_sai_id1 : 1;
65  uint32_t vc0_sai_id2 : 1;
66  uint32_t vc0_sai_id3 : 1;
67  uint32_t vc1_sai_id0 : 1;
68  uint32_t vc1_sai_id1 : 1;
69  uint32_t vc1_sai_id2 : 1;
70  uint32_t vc1_sai_id3 : 1;
71  uint32_t : 13;
72  uint32_t punit : 1;
73  uint32_t : 1;
74  uint32_t esram_flush_init : 1;
75  };
76  uint32_t raw;
77 } quarkX1000_imr_rdmsk_t;
78 
79 typedef union quarkX1000_imr_wrmsk {
80  struct {
81  uint32_t cpu0 : 1;
82  uint32_t cpu_0 : 1;
83  uint32_t : 6;
84  uint32_t vc0_sai_id0 : 1;
85  uint32_t vc0_sai_id1 : 1;
86  uint32_t vc0_sai_id2 : 1;
87  uint32_t vc0_sai_id3 : 1;
88  uint32_t vc1_sai_id0 : 1;
89  uint32_t vc1_sai_id1 : 1;
90  uint32_t vc1_sai_id2 : 1;
91  uint32_t vc1_sai_id3 : 1;
92  uint32_t : 13;
93  uint32_t punit : 1;
94  uint32_t cpu_snoop : 1;
95  uint32_t esram_flush_init : 1;
96  };
97  uint32_t raw;
98 } quarkX1000_imr_wrmsk_t;
99 
100 /* Refer to Intel Quark SoC X1000 Datasheet, Section 12.7.4 for more details on
101  * the IMR registers.
102  */
103 typedef struct quarkX1000_imr {
104  quarkX1000_imr_lo_t lo;
105  quarkX1000_imr_hi_t hi;
106  quarkX1000_imr_rdmsk_t rdmsk;
107  quarkX1000_imr_wrmsk_t wrmsk;
108 } quarkX1000_imr_t;
109 
110 /* The Intel Quark SoC X1000 defines eight general IMRs. */
111 #define QUARKX1000_IMR_CNT 8
112 
113 /* Routines for accessing the Isolated Memory Region (IMR) feature.
114  *
115  * The Intel Quark X1000 SoC includes support for Isolated Memory Regions
116  * (IMRs), which are specified using range registers and associated
117  * control registers that are accessible via the message bus.
118  *
119  * Refer to Intel Quark SoC X1000 Datasheet, Section 12.2 for more information.
120  */
121 
122 quarkX1000_imr_t quarkX1000_imr_read(uint32_t imr_idx);
123 void quarkX1000_imr_write(uint32_t imr_idx, quarkX1000_imr_t imr);
124 
125 #endif /* CPU_X86_DRIVERS_QUARKX1000_IMR_H_ */
static uip_ds6_addr_t * addr
Pointer to a router list entry.
Definition: uip-nd6.c:124