lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 1 | // Copyright lowRISC contributors. |
| 2 | // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| 3 | // SPDX-License-Identifier: Apache-2.0 |
| 4 | // |
| 5 | // TOP Earlgrey configuration |
| 6 | { name: "earlgrey", |
| 7 | type: "top", |
| 8 | |
| 9 | datawidth: "32", # 32-bit datawidth |
| 10 | |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 11 | // This is the clock data strcture of the design. |
Timothy Chen | f56c1b5 | 2020-04-28 17:00:43 -0700 | [diff] [blame] | 12 | // The hier path refers to the clock reference path (struct / port) |
| 13 | // - The top/ext desgination follows the same scheme as inter-module |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 14 | // The src key indicates the raw clock sources in the design |
| 15 | // The groups key indicates the various clock groupings in the design |
| 16 | clocks: { |
| 17 | |
Timothy Chen | f56c1b5 | 2020-04-28 17:00:43 -0700 | [diff] [blame] | 18 | hier_paths: { |
| 19 | top: "clkmgr_clocks.", // top level is a struct |
| 20 | ext: "", // ext is a port of the clock name |
| 21 | }, |
| 22 | |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 23 | // Clock Source attributes |
| 24 | // name: Name of group. |
| 25 | // aon: Whether the clock is free running all the time. |
| 26 | // If it is, the clock is not hanlded by clkmgr. |
| 27 | // freq: Absolute frequency of clk in Hz |
| 28 | |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 29 | srcs: [ |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 30 | { name: "main", aon: "no", freq: "100000000" } |
| 31 | { name: "io", aon: "no", freq: "100000000" } |
| 32 | { name: "usb", aon: "no", freq: "48000000" } |
| 33 | { name: "aon", aon: "yes", freq: "200000" } |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 34 | ], |
| 35 | |
| 36 | // Clock Group attributes |
| 37 | // name: name of group. |
| 38 | // |
Timothy Chen | f56c1b5 | 2020-04-28 17:00:43 -0700 | [diff] [blame] | 39 | // src: The hierarchical source of the clock |
| 40 | // "ext" - clock is supplied from a port of the top module |
| 41 | // "top" - clock is supplied from a net inside the top module |
| 42 | // |
Rupert Swarbrick | cba33a2 | 2020-07-02 16:46:38 +0100 | [diff] [blame^] | 43 | // sw_cg: whether software is allowed to gate the clock |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 44 | // "no" - software is not allowed to gate clocks |
| 45 | // "yes" - software is allowed to gate clocks |
| 46 | // "hint" - software can provide a hint, and hw controls the rest |
| 47 | // |
| 48 | // unique: whether each module in the group can be separately gated |
Rupert Swarbrick | cba33a2 | 2020-07-02 16:46:38 +0100 | [diff] [blame^] | 49 | // if sw_cg is "no", this field has no meaning |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 50 | // "yes" - each clock is individually controlled |
| 51 | // "no" - the group is controlled as one single unit |
| 52 | // |
| 53 | // The powerup and proc groups are unique. |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 54 | // The powerup group of clocks do not feed through the clock |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 55 | // controller as they manage clock controller behavior |
| 56 | // The proc group is not peripheral, and direclty hardwired |
| 57 | |
| 58 | groups: [ |
Timothy Chen | f56c1b5 | 2020-04-28 17:00:43 -0700 | [diff] [blame] | 59 | { name: "powerup", src:"ext", sw_cg: "no" } |
| 60 | { name: "trans", src:"top", sw_cg: "hint", unique: "yes", } |
| 61 | { name: "infra", src:"top", sw_cg: "no", } |
| 62 | { name: "secure", src:"top", sw_cg: "no" } |
| 63 | { name: "peri", src:"top", sw_cg: "yes", unique: "no" } |
| 64 | { name: "timers", src:"top", sw_cg: "no" } |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 65 | { name: "proc", |
Timothy Chen | f56c1b5 | 2020-04-28 17:00:43 -0700 | [diff] [blame] | 66 | src: "no" |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 67 | sw_cg: "no" |
| 68 | unique: "no" |
| 69 | clocks: { |
| 70 | clk_proc_main: main |
| 71 | } |
| 72 | } |
| 73 | ], |
| 74 | } |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 75 | |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 76 | // Reset attributes |
Timothy Chen | e8cb3bd | 2020-04-14 16:12:26 -0700 | [diff] [blame] | 77 | // name: name of reset. |
Timothy Chen | e8cb3bd | 2020-04-14 16:12:26 -0700 | [diff] [blame] | 78 | // |
Timothy Chen | a4cc10d | 2020-05-08 16:06:20 -0700 | [diff] [blame] | 79 | // type: the reset type [ext, top] |
| 80 | // ext: the reset is coming in from the ports, external to earlgrey |
| 81 | // top: the reset is coming from top level, the rstmgr output struct |
| 82 | // |
| 83 | // root: The parent reset |
| 84 | // If type is "ext", there is no root, since it is external |
Timothy Chen | e8cb3bd | 2020-04-14 16:12:26 -0700 | [diff] [blame] | 85 | // |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 86 | // clk: related clock domain for synchronous release |
Timothy Chen | e8cb3bd | 2020-04-14 16:12:26 -0700 | [diff] [blame] | 87 | // If type is "por", there is not related clock, since it is |
| 88 | // likely external or generated from a voltage comparator |
| 89 | // |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 90 | resets: [ |
Timothy Chen | a4cc10d | 2020-05-08 16:06:20 -0700 | [diff] [blame] | 91 | { name: "rst_ni", type: "ext" } |
| 92 | { name: "por_aon", type: "top", root: "rst_ni", clk: "aon" } |
| 93 | { name: "por", type: "top", root: "por_aon", clk: "main" } |
| 94 | { name: "por_io", type: "top", root: "por_aon", clk: "io" } |
| 95 | { name: "por_usb", type: "top", root: "por_aon", clk: "usb" } |
| 96 | { name: "lc", type: "top", root: "lc", clk: "io" } |
| 97 | { name: "sys", type: "top", root: "sys", clk: "main" } |
| 98 | { name: "sys_io", type: "top", root: "sys", clk: "io" } |
| 99 | { name: "sys_aon", type: "top", root: "sys", clk: "io" } |
| 100 | { name: "spi_device", type: "top", root: "sys", clk: "io", sw: 1 } |
| 101 | { name: "usb", type: "top", root: "sys", clk: "usb", sw: 1 } |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 102 | ] |
| 103 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 104 | // Number of cores: used in rv_plic and timer |
| 105 | num_cores: "1", |
| 106 | |
| 107 | // `module` defines the peripherals. |
| 108 | // Details are coming from each modules' config file `ip.hjson` |
| 109 | // TODO: Define parameter here |
| 110 | module: [ |
| 111 | { name: "uart", // instance name |
| 112 | type: "uart", // Must be matched to the ip name in `ip.hson` (_reg, _cfg permitted) |
| 113 | // and `hw/ip/{type}` |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 114 | |
Timothy Chen | 80bd8aa | 2019-10-04 15:57:11 -0700 | [diff] [blame] | 115 | // clock connections defines the port to top level clock connection |
| 116 | // the ip.hjson will declare the clock port names |
| 117 | // If none are defined at ip.hjson, clk_i is used by default |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 118 | clock_srcs: {clk_i: "io"}, |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 119 | |
| 120 | // reset connections defines the port to top level reset connection |
| 121 | // the ip.hjson will declare the reset port names |
Timothy Chen | 80bd8aa | 2019-10-04 15:57:11 -0700 | [diff] [blame] | 122 | // If none are defined at ip.hjson, rst_ni is used by default |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 123 | reset_connections: {rst_ni: "sys_io"}, |
Timothy Chen | 80bd8aa | 2019-10-04 15:57:11 -0700 | [diff] [blame] | 124 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 125 | base_addr: "0x40000000", |
| 126 | }, |
| 127 | { name: "gpio", |
| 128 | type: "gpio", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 129 | clock_srcs: {clk_i: "io"}, |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 130 | clock_group: "peri", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 131 | reset_connections: {rst_ni: "sys_io"}, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 132 | base_addr: "0x40010000", |
| 133 | } |
| 134 | |
| 135 | { name: "spi_device", |
| 136 | type: "spi_device", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 137 | clock_srcs: {clk_i: "io"}, |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 138 | clock_group: "peri", |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 139 | reset_connections: {rst_ni: "spi_device"}, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 140 | base_addr: "0x40020000", |
| 141 | }, |
| 142 | { name: "flash_ctrl", |
| 143 | type: "flash_ctrl", |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 144 | clock_srcs: {clk_i: "main"}, |
| 145 | clock_group: "infra", |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 146 | reset_connections: {rst_ni: "lc"}, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 147 | base_addr: "0x40030000", |
| 148 | }, |
| 149 | { name: "rv_timer", |
| 150 | type: "rv_timer", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 151 | clock_srcs: {clk_i: "io"}, |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 152 | clock_group: "timers", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 153 | reset_connections: {rst_ni: "sys_io"}, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 154 | base_addr: "0x40080000", |
| 155 | }, |
Pirmin Vogel | d453438 | 2019-10-17 13:18:31 +0100 | [diff] [blame] | 156 | { name: "aes", |
| 157 | type: "aes", |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 158 | clock_srcs: {clk_i: "main"}, |
| 159 | clock_group: "trans", |
Pirmin Vogel | d453438 | 2019-10-17 13:18:31 +0100 | [diff] [blame] | 160 | reset_connections: {rst_ni: "sys"}, |
| 161 | base_addr: "0x40110000", |
| 162 | }, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 163 | { name: "hmac", |
| 164 | type: "hmac", |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 165 | clock_srcs: {clk_i: "main"}, |
| 166 | clock_group: "trans", |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 167 | reset_connections: {rst_ni: "sys"}, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 168 | base_addr: "0x40120000", |
| 169 | }, |
| 170 | { name: "rv_plic", |
| 171 | type: "rv_plic", |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 172 | clock_srcs: {clk_i: "main"}, |
| 173 | clock_group: "secure", |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 174 | reset_connections: {rst_ni: "sys"}, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 175 | base_addr: "0x40090000", |
| 176 | generated: "true" // Indicate this module is generated in the topgen |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 177 | } |
Eunchan Kim | 436d224 | 2019-10-29 17:25:51 -0700 | [diff] [blame] | 178 | { name: "pinmux", |
| 179 | type: "pinmux", |
| 180 | clock: "main", |
Timothy Chen | 1faeb3c | 2020-05-11 22:06:32 -0700 | [diff] [blame] | 181 | clock_srcs: {clk_i: "main", clk_aon_i: "io"}, |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 182 | clock_group: "secure", |
Timothy Chen | 1faeb3c | 2020-05-11 22:06:32 -0700 | [diff] [blame] | 183 | reset_connections: {rst_ni: "sys", rst_aon_ni: "sys_io"}, |
Eunchan Kim | 436d224 | 2019-10-29 17:25:51 -0700 | [diff] [blame] | 184 | base_addr: "0x40070000", |
| 185 | generated: "true" |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 186 | }, |
Michael Schaffner | 6015796 | 2020-05-01 19:11:28 -0700 | [diff] [blame] | 187 | { name: "padctrl", |
| 188 | type: "padctrl", |
| 189 | clock: "main", |
| 190 | clock_srcs: {clk_i: "main"}, |
| 191 | clock_group: "secure", |
| 192 | reset_connections: {rst_ni: "sys"}, |
| 193 | base_addr: "0x40160000", |
| 194 | generated: "true" |
| 195 | }, |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 196 | { name: "alert_handler", |
| 197 | type: "alert_handler", |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 198 | clock_srcs: {clk_i: "main"}, |
| 199 | clock_group: "secure", |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 200 | reset_connections: {rst_ni: "sys"}, |
| 201 | base_addr: "0x40130000", |
| 202 | generated: "true" // Indicate this module is generated in the topgen |
| 203 | localparam: { |
| 204 | EscCntDw: 32, |
| 205 | AccuCntDw: 16, |
| 206 | LfsrSeed: "0x7FFFFFFF" |
| 207 | } |
| 208 | } |
Timothy Chen | 163050b | 2020-04-13 23:29:29 -0700 | [diff] [blame] | 209 | { name: "pwrmgr", |
| 210 | type: "pwrmgr", |
Timothy Chen | a4cc10d | 2020-05-08 16:06:20 -0700 | [diff] [blame] | 211 | clock_srcs: {clk_i: "io", clk_slow_i: "aon"}, |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 212 | clock_group: "powerup", |
Timothy Chen | a4cc10d | 2020-05-08 16:06:20 -0700 | [diff] [blame] | 213 | reset_connections: {rst_ni: "por", rst_slow_ni: "por_aon"}, |
Timothy Chen | 163050b | 2020-04-13 23:29:29 -0700 | [diff] [blame] | 214 | base_addr: "0x400A0000", |
Timothy Chen | 4ba2531 | 2020-06-17 13:08:57 -0700 | [diff] [blame] | 215 | generated: "true" // Indicate this module is generated in the topgen |
Timothy Chen | f56c1b5 | 2020-04-28 17:00:43 -0700 | [diff] [blame] | 216 | |
Timothy Chen | 163050b | 2020-04-13 23:29:29 -0700 | [diff] [blame] | 217 | }, |
Timothy Chen | c59f701 | 2020-04-16 19:11:42 -0700 | [diff] [blame] | 218 | { name: "rstmgr", |
| 219 | type: "rstmgr", |
Timothy Chen | a4cc10d | 2020-05-08 16:06:20 -0700 | [diff] [blame] | 220 | clock_srcs: {clk_i: "io", clk_aon_i: "aon", clk_main_i: "main", clk_io_i: "io", clk_usb_i: "usb"}, |
Timothy Chen | c59f701 | 2020-04-16 19:11:42 -0700 | [diff] [blame] | 221 | clock_group: "powerup", |
| 222 | reset_connections: {rst_ni: "rst_ni"}, |
| 223 | base_addr: "0x400B0000", |
Timothy Chen | f56c1b5 | 2020-04-28 17:00:43 -0700 | [diff] [blame] | 224 | }, |
| 225 | { name: "clkmgr", |
| 226 | type: "clkmgr", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 227 | clock_srcs: {clk_i: "io", clk_main_i: "main", clk_io_i: "io", clk_usb_i: "usb", clk_aon_i: "aon"}, |
Timothy Chen | f56c1b5 | 2020-04-28 17:00:43 -0700 | [diff] [blame] | 228 | clock_group: "powerup", |
Timothy Chen | a4cc10d | 2020-05-08 16:06:20 -0700 | [diff] [blame] | 229 | reset_connections: {rst_ni: "por_io", rst_main_ni: "por", rst_io_ni: "por_io", rst_usb_ni: "por_usb"}, |
Timothy Chen | f56c1b5 | 2020-04-28 17:00:43 -0700 | [diff] [blame] | 230 | base_addr: "0x400C0000", |
Timothy Chen | c59f701 | 2020-04-16 19:11:42 -0700 | [diff] [blame] | 231 | generated: "true" |
| 232 | }, |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 233 | // dummy module to capture the alert handler escalation signals |
| 234 | // and test them by converting them into IRQs |
| 235 | { name: "nmi_gen", |
| 236 | type: "nmi_gen", |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 237 | clock_srcs: {clk_i: "main"}, |
| 238 | clock_group: "secure", |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 239 | reset_connections: {rst_ni: "sys"}, |
| 240 | base_addr: "0x40140000", |
Eunchan Kim | 436d224 | 2019-10-29 17:25:51 -0700 | [diff] [blame] | 241 | } |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 242 | { name: "usbdev", |
| 243 | type: "usbdev", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 244 | clock_srcs: {clk_i: "io", clk_usb_48mhz_i: "usb"}, |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 245 | clock_group: "peri", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 246 | reset_connections: {rst_ni: "sys_io", rst_usb_48mhz_ni: "usb"}, |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 247 | base_addr: "0x40150000", |
| 248 | }, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 249 | ] |
| 250 | |
| 251 | // Memories (ROM, RAM, eFlash) are defined at the top. |
| 252 | // It utilizes the primitive cells but configurable |
| 253 | memory: [ |
Timothy Chen | 80bd8aa | 2019-10-04 15:57:11 -0700 | [diff] [blame] | 254 | { name: "rom", |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 255 | clock_srcs: {clk_i: "main"}, |
| 256 | clock_group: "infra", |
Timothy Chen | 80bd8aa | 2019-10-04 15:57:11 -0700 | [diff] [blame] | 257 | reset_connections: {rst_ni: "sys"}, |
| 258 | type: "rom", |
| 259 | base_addr: "0x00008000", |
Weicai Yang | 55b2cdf | 2020-04-10 15:40:30 -0700 | [diff] [blame] | 260 | swaccess: "ro", |
Timothy Chen | da2e344 | 2020-02-24 21:37:47 -0800 | [diff] [blame] | 261 | size: "0x4000" |
Timothy Chen | 80bd8aa | 2019-10-04 15:57:11 -0700 | [diff] [blame] | 262 | }, |
| 263 | { name: "ram_main", |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 264 | clock_srcs: {clk_i: "main"}, |
| 265 | clock_group: "infra", |
Timothy Chen | 80bd8aa | 2019-10-04 15:57:11 -0700 | [diff] [blame] | 266 | reset_connections: {rst_ni: "sys"}, |
| 267 | type: "ram_1p", |
| 268 | base_addr: "0x10000000", |
| 269 | size: "0x10000" }, |
Timothy Chen | 2c9e1a9 | 2020-06-29 15:03:25 -0700 | [diff] [blame] | 270 | |
| 271 | { name: "ram_ret", |
| 272 | clock_srcs: {clk_i: "io"}, |
| 273 | clock_group: "infra", |
| 274 | reset_connections: {rst_ni: "sys_io"}, |
| 275 | type: "ram_1p", |
| 276 | base_addr: "0x18000000", |
| 277 | size: "0x1000" }, |
Timothy Chen | 80bd8aa | 2019-10-04 15:57:11 -0700 | [diff] [blame] | 278 | { name: "eflash", |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 279 | clock_srcs: {clk_i: "main"}, |
| 280 | clock_group: "infra", |
Timothy Chen | 80bd8aa | 2019-10-04 15:57:11 -0700 | [diff] [blame] | 281 | reset_connections: {rst_ni: "lc"}, |
| 282 | type: "eflash", |
| 283 | base_addr: "0x20000000", |
Weicai Yang | 55b2cdf | 2020-04-10 15:40:30 -0700 | [diff] [blame] | 284 | swaccess: "ro", |
Eunchan Kim | e4a8507 | 2020-02-05 16:00:00 -0800 | [diff] [blame] | 285 | size: "0x80000", |
| 286 | inter_signal_list: [ |
| 287 | { struct: "flash", // flash_req_t, flash_rsp_t |
| 288 | type: "req_rsp", |
| 289 | name: "flash_ctrl", // flash_ctrl_i (req), flash_ctrl_o (rsp) |
Eunchan Kim | 40098a9 | 2020-04-17 12:22:36 -0700 | [diff] [blame] | 290 | act: "rsp", |
Eunchan Kim | e4a8507 | 2020-02-05 16:00:00 -0800 | [diff] [blame] | 291 | } |
| 292 | ], |
| 293 | }, |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 294 | ], |
| 295 | |
Eunchan Kim | e4a8507 | 2020-02-05 16:00:00 -0800 | [diff] [blame] | 296 | // Inter-module Connection. |
| 297 | // format: |
| 298 | // requester: [ resp1, resp2, ... ], |
| 299 | // |
Eunchan Kim | 40098a9 | 2020-04-17 12:22:36 -0700 | [diff] [blame] | 300 | // the field and value should be module_inst.port_name |
Eunchan Kim | e4a8507 | 2020-02-05 16:00:00 -0800 | [diff] [blame] | 301 | // e.g flash_ctrl0.flash: [flash_phy0.flash_ctrl] |
| 302 | inter_module: { |
Eunchan Kim | 40098a9 | 2020-04-17 12:22:36 -0700 | [diff] [blame] | 303 | 'connect': { |
| 304 | 'flash_ctrl.flash': ['eflash.flash_ctrl'] |
Timothy Chen | c59f701 | 2020-04-16 19:11:42 -0700 | [diff] [blame] | 305 | 'pwrmgr.pwr_rst' : ['rstmgr.pwr'], |
Timothy Chen | f56c1b5 | 2020-04-28 17:00:43 -0700 | [diff] [blame] | 306 | 'pwrmgr.pwr_clk' : ['clkmgr.pwr'], |
Eunchan Kim | 40098a9 | 2020-04-17 12:22:36 -0700 | [diff] [blame] | 307 | } |
| 308 | |
| 309 | // top is to connect to top net/struct. |
| 310 | // It defines the signal in the top and connect from the module, |
| 311 | // use of the signal is up to top template |
Timothy Chen | f56c1b5 | 2020-04-28 17:00:43 -0700 | [diff] [blame] | 312 | 'top': ['rstmgr.resets', 'rstmgr.cpu', 'pwrmgr.pwr_cpu', 'clkmgr.clocks'], |
Eunchan Kim | 40098a9 | 2020-04-17 12:22:36 -0700 | [diff] [blame] | 313 | |
| 314 | // ext is to create port in the top. |
Eunchan Kim | 1d5bbcc | 2020-04-27 20:51:38 -0700 | [diff] [blame] | 315 | 'external': [], |
Eunchan Kim | e4a8507 | 2020-02-05 16:00:00 -0800 | [diff] [blame] | 316 | }, |
| 317 | |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 318 | debug_mem_base_addr: "0x1A110000", |
| 319 | |
| 320 | // Crossbars: having a top level crossbar |
| 321 | // This version assumes all crossbars are instantiated at the top. |
| 322 | // Assume xbar.hjson is located in the same directory of top.hjson |
| 323 | xbar: [ |
| 324 | { name: "main", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 325 | clock_srcs: {clk_main_i: "main", clk_fixed_i: "io"}, |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 326 | clock_group: "infra", |
Timothy Chen | 3193b00 | 2019-10-04 16:56:05 -0700 | [diff] [blame] | 327 | reset: "sys", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 328 | reset_connections: {rst_main_ni: "sys", rst_fixed_ni: "sys_io"} |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 329 | }, |
Eunchan Kim | 0523f6b | 2019-12-17 13:53:11 -0800 | [diff] [blame] | 330 | { name: "peri", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 331 | clock_srcs: {clk_peri_i: "io"}, |
Timothy Chen | 0550d69 | 2020-04-20 17:19:35 -0700 | [diff] [blame] | 332 | clock_group: "infra", |
Timothy Chen | 33b3b9d | 2020-05-08 10:14:17 -0700 | [diff] [blame] | 333 | reset: "sys_io", |
| 334 | reset_connections: {rst_peri_ni: "sys_io"}, |
Eunchan Kim | 0523f6b | 2019-12-17 13:53:11 -0800 | [diff] [blame] | 335 | } |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 336 | ], |
| 337 | |
| 338 | // ===== INTERRUPT CTRL ===================================================== |
| 339 | // `rv_plic` will be instantiate (need to be defined in `module` field |
| 340 | // If interrupt is not defined, it uses the order from the module list |
| 341 | // and include every modules. |
| 342 | // first item goes to LSB of the interrupt source |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 343 | interrupt_module: ["gpio", "uart", "spi_device", "flash_ctrl", |
Timothy Chen | 163050b | 2020-04-13 23:29:29 -0700 | [diff] [blame] | 344 | "hmac", "alert_handler", "nmi_gen", "usbdev", "pwrmgr" ] |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 345 | |
| 346 | // RV_PLIC has two searching algorithm internally to pick the most highest priority interrupt |
| 347 | // source. "sequential" is smaller but slower, "matrix" is larger but faster. |
| 348 | // Choose depends on the criteria. Currently it is set to "matrix" to meet FPGA timing @ 50MHz |
| 349 | |
| 350 | // generated: |
| 351 | interrupt: [ |
| 352 | ] |
| 353 | |
Michael Schaffner | 666dde1 | 2019-10-25 11:57:54 -0700 | [diff] [blame] | 354 | // ===== ALERT HANDLER ====================================================== |
| 355 | // list all modules that expose alerts |
| 356 | // first item goes to LSB of the interrupt source |
| 357 | alert_module: [ "hmac" ] |
| 358 | |
| 359 | // generated list of alerts: |
| 360 | alert: [ |
| 361 | ] |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 362 | |
| 363 | // TODO: PINMUX |
Eunchan Kim | 632c6f7 | 2019-09-30 11:11:51 -0700 | [diff] [blame] | 364 | pinmux: { |
| 365 | |
Eunchan Kim | 436d224 | 2019-10-29 17:25:51 -0700 | [diff] [blame] | 366 | // Total number of Multiplexed I/O |
| 367 | // All the input/outputs from IPs are muxed in pinmux, and it has # of I/O |
| 368 | // talks to the outside of top_earlgrey. |
| 369 | // This field will be replaced to the length of PAD if padctrl is defined |
| 370 | num_mio: 32 |
| 371 | |
Eunchan Kim | 632c6f7 | 2019-09-30 11:11:51 -0700 | [diff] [blame] | 372 | // Dedicated IO modules. The in/out ports of the modules below are connected |
| 373 | // to TOP IO port through PADS directly. It bypasses PINMUX multiplexers |
| 374 | dio_modules: [ |
| 375 | { name: "spi_device", pad: ["ChB[0..3]"] }, |
Eunchan Kim | 436d224 | 2019-10-29 17:25:51 -0700 | [diff] [blame] | 376 | //{ name: "uart.tx", pad: ["ChA[0]"]}, |
| 377 | { name: "uart", pad: ["ChA[0..1]"]}, |
Eunchan Kim | 632c6f7 | 2019-09-30 11:11:51 -0700 | [diff] [blame] | 378 | // { name: "dio_module.signal_input", pad: ["ChA[31]"] } |
Pirmin Vogel | fe6863b | 2020-05-11 17:30:54 +0200 | [diff] [blame] | 379 | { name: "usbdev", pad: ["ChC[0..8]"]}, |
Eunchan Kim | 632c6f7 | 2019-09-30 11:11:51 -0700 | [diff] [blame] | 380 | ], |
| 381 | |
| 382 | // Multiplexing IO modules. The in/out ports of the modules below are |
| 383 | // connected through PINMUX, which gives controllability of the connection |
| 384 | // between the modules and the IO PADS. |
| 385 | // If `mio_modules` aren't defined, it uses all remaining modules from |
| 386 | // module list except defined in `dio_modules`. |
| 387 | mio_modules: ["uart", "gpio"] |
| 388 | |
| 389 | // If any module isn't defined in above two lists, its inputs will be tied |
| 390 | // to 0, and the output/OE signals will be floating (or connected to |
| 391 | // unused signal). `rv_plic` is special module, shouldn't be defined here. |
| 392 | nc_modules: ["rv_timer", "hmac"] |
| 393 | |
Michael Schaffner | 57c490d | 2020-04-29 15:08:55 -0700 | [diff] [blame] | 394 | // Number of wakeup detectors to instantiate, and bitwidth for the wakeup |
| 395 | // counters. Note that all MIO pad inputs are connected to the wakeup detectors, |
| 396 | // and there is no way to disable this. DIO inputs on the other hand are by |
| 397 | // default not connected. |
| 398 | // TODO: need to add mechanism to mark them as wakeup pins. |
| 399 | num_wkup_detect: 8 |
| 400 | wkup_cnt_width: 8 |
| 401 | |
Eunchan Kim | 632c6f7 | 2019-09-30 11:11:51 -0700 | [diff] [blame] | 402 | // Below fields are generated. |
| 403 | // inputs: [ |
| 404 | // { name: "xxx", width: xx }, |
| 405 | // ] |
| 406 | // outputs: [ |
| 407 | // { name: "xxx", width: xx }, |
| 408 | // ] |
| 409 | // inouts: [ |
| 410 | // { name: "xxx", width: xx }, |
| 411 | // ] |
| 412 | } |
| 413 | |
| 414 | // PADS instantiation |
| 415 | // Number of in/outs and the numer of PAD instances doesn't have to be |
| 416 | // same. The number given below excludes clock/reset and other necessary |
| 417 | // PADS but only defines GPIO pads. |
| 418 | padctrl: { |
| 419 | attr_default: ["STRONG"], |
| 420 | pads: [ |
| 421 | { name: "ChA" type: "IO_33V", count: 32 }, // Accessing as ChA[0] .. ChA[31] |
| 422 | { name: "ChB" type: "IO_33V", count: 4, attr: ["KEEP", "WEAK"]}, |
Pirmin Vogel | ea91b30 | 2020-01-14 18:53:01 +0000 | [diff] [blame] | 423 | { name: "ChC" type: "IO_33V", count: 4, attr: ["KEEP", "STRONG"]}, |
Eunchan Kim | 632c6f7 | 2019-09-30 11:11:51 -0700 | [diff] [blame] | 424 | ] |
| 425 | } |
lowRISC Contributors | 802543a | 2019-08-31 12:12:56 +0100 | [diff] [blame] | 426 | |
| 427 | } |