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