Simon Glass | 4cc43bf | 2021-08-18 21:40:25 -0600 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 2 | /* |
| 3 | * This is the common sandbox device-tree nodes. This is shared between sandbox |
| 4 | * and sandbox64 builds. |
| 5 | */ |
| 6 | |
| 7 | #define USB_CLASS_HUB 9 |
| 8 | |
| 9 | / { |
| 10 | chosen { |
| 11 | stdout-path = "/serial"; |
| 12 | }; |
| 13 | |
| 14 | audio: audio-codec { |
| 15 | compatible = "sandbox,audio-codec"; |
| 16 | #sound-dai-cells = <1>; |
| 17 | }; |
| 18 | |
Philippe Reynes | f56bf0a | 2020-07-24 18:19:48 +0200 | [diff] [blame] | 19 | buttons { |
| 20 | compatible = "gpio-keys"; |
| 21 | |
Heinrich Schuchardt | 57c2fc6 | 2020-09-14 12:50:54 +0200 | [diff] [blame] | 22 | btn1 { |
Philippe Reynes | f56bf0a | 2020-07-24 18:19:48 +0200 | [diff] [blame] | 23 | gpios = <&gpio_a 3 0>; |
Heinrich Schuchardt | 57c2fc6 | 2020-09-14 12:50:54 +0200 | [diff] [blame] | 24 | label = "button1"; |
Philippe Reynes | f56bf0a | 2020-07-24 18:19:48 +0200 | [diff] [blame] | 25 | }; |
| 26 | |
Heinrich Schuchardt | 57c2fc6 | 2020-09-14 12:50:54 +0200 | [diff] [blame] | 27 | btn2 { |
Philippe Reynes | f56bf0a | 2020-07-24 18:19:48 +0200 | [diff] [blame] | 28 | gpios = <&gpio_a 4 0>; |
Heinrich Schuchardt | 57c2fc6 | 2020-09-14 12:50:54 +0200 | [diff] [blame] | 29 | label = "button2"; |
Philippe Reynes | f56bf0a | 2020-07-24 18:19:48 +0200 | [diff] [blame] | 30 | }; |
| 31 | }; |
| 32 | |
Simon Glass | 6b927b1 | 2020-10-03 11:31:32 -0600 | [diff] [blame] | 33 | clk_fixed: clk-fixed { |
| 34 | u-boot,dm-pre-reloc; |
Simon Glass | 9bb88fb | 2021-03-15 17:25:24 +1300 | [diff] [blame] | 35 | compatible = "sandbox,fixed-clock"; |
Simon Glass | 6b927b1 | 2020-10-03 11:31:32 -0600 | [diff] [blame] | 36 | #clock-cells = <0>; |
| 37 | clock-frequency = <1234>; |
| 38 | }; |
| 39 | |
| 40 | clk_sandbox: clk-sbox { |
| 41 | u-boot,dm-pre-reloc; |
| 42 | compatible = "sandbox,clk"; |
| 43 | #clock-cells = <1>; |
| 44 | assigned-clocks = <&clk_sandbox 3>; |
| 45 | assigned-clock-rates = <321>; |
| 46 | }; |
| 47 | |
| 48 | clk-test { |
| 49 | u-boot,dm-pre-reloc; |
| 50 | compatible = "sandbox,clk-test"; |
| 51 | clocks = <&clk_fixed>, |
| 52 | <&clk_sandbox 1>, |
| 53 | <&clk_sandbox 0>, |
| 54 | <&clk_sandbox 3>, |
| 55 | <&clk_sandbox 2>; |
| 56 | clock-names = "fixed", "i2c", "spi", "uart2", "uart1"; |
| 57 | }; |
| 58 | |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 59 | gpio_a: gpios@0 { |
Simon Glass | e98524a | 2020-12-19 10:39:56 -0700 | [diff] [blame] | 60 | u-boot,dm-pre-proper; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 61 | gpio-controller; |
| 62 | compatible = "sandbox,gpio"; |
| 63 | #gpio-cells = <1>; |
| 64 | gpio-bank-name = "a"; |
| 65 | sandbox,gpio-count = <20>; |
| 66 | }; |
| 67 | |
| 68 | gpio_b: gpios@1 { |
Simon Glass | 2149e11 | 2021-08-07 07:24:12 -0600 | [diff] [blame] | 69 | u-boot,dm-spl; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 70 | gpio-controller; |
| 71 | compatible = "sandbox,gpio"; |
| 72 | #gpio-cells = <2>; |
| 73 | gpio-bank-name = "b"; |
| 74 | sandbox,gpio-count = <10>; |
| 75 | }; |
| 76 | |
Simon Glass | 2149e11 | 2021-08-07 07:24:12 -0600 | [diff] [blame] | 77 | gpio-test { |
| 78 | u-boot,dm-spl; |
| 79 | compatible = "sandbox,gpio-test"; |
| 80 | test-gpios = <&gpio_b 3 0>; |
| 81 | }; |
| 82 | |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 83 | hexagon { |
| 84 | compatible = "demo-simple"; |
| 85 | colour = "white"; |
| 86 | sides = <6>; |
| 87 | }; |
| 88 | |
| 89 | i2c_0: i2c@0 { |
| 90 | eeprom@2c { |
| 91 | reg = <0x2c>; |
| 92 | compatible = "i2c-eeprom"; |
| 93 | sandbox,emul = <&emul_eeprom>; |
| 94 | }; |
| 95 | |
| 96 | rtc_0: rtc@43 { |
| 97 | reg = <0x43>; |
| 98 | compatible = "sandbox-rtc"; |
| 99 | sandbox,emul = <&emul0>; |
Simon Glass | 4d4558e | 2020-10-03 11:31:36 -0600 | [diff] [blame] | 100 | u-boot,dm-pre-reloc; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 101 | }; |
| 102 | sandbox_pmic: sandbox_pmic { |
| 103 | reg = <0x40>; |
| 104 | }; |
| 105 | |
| 106 | mc34708: pmic@41 { |
| 107 | reg = <0x41>; |
| 108 | }; |
| 109 | |
| 110 | i2c_emul: emul { |
Simon Glass | 9db623b | 2021-02-03 06:01:16 -0700 | [diff] [blame] | 111 | u-boot,dm-pre-reloc; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 112 | reg = <0xff>; |
| 113 | compatible = "sandbox,i2c-emul-parent"; |
| 114 | emul_eeprom: emul-eeprom { |
| 115 | compatible = "sandbox,i2c-eeprom"; |
| 116 | sandbox,filename = "i2c.bin"; |
| 117 | sandbox,size = <256>; |
Simon Glass | 9db623b | 2021-02-03 06:01:16 -0700 | [diff] [blame] | 118 | #emul-cells = <0>; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 119 | }; |
| 120 | emul0: emul0 { |
Simon Glass | 9db623b | 2021-02-03 06:01:16 -0700 | [diff] [blame] | 121 | u-boot,dm-pre-reloc; |
| 122 | compatible = "sandbox,i2c-rtc-emul"; |
| 123 | #emul-cells = <0>; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 124 | }; |
| 125 | }; |
| 126 | }; |
| 127 | |
| 128 | i2s: i2s { |
| 129 | compatible = "sandbox,i2s"; |
| 130 | #sound-dai-cells = <1>; |
| 131 | }; |
| 132 | |
Simon Glass | e7995f7 | 2021-08-07 07:24:11 -0600 | [diff] [blame] | 133 | irq_sandbox: irq-sbox { |
| 134 | u-boot,dm-spl; |
| 135 | compatible = "sandbox,irq"; |
| 136 | interrupt-controller; |
| 137 | #interrupt-cells = <2>; |
| 138 | }; |
| 139 | |
| 140 | irq-test { |
| 141 | u-boot,dm-spl; |
| 142 | compatible = "sandbox,irq-test"; |
| 143 | interrupts-extended = <&irq_sandbox 3 0>; |
| 144 | }; |
| 145 | |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 146 | lcd { |
Simon Glass | e98524a | 2020-12-19 10:39:56 -0700 | [diff] [blame] | 147 | u-boot,dm-pre-proper; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 148 | compatible = "sandbox,lcd-sdl"; |
| 149 | xres = <1366>; |
| 150 | yres = <768>; |
Simon Glass | d2caf7b | 2020-02-03 07:36:14 -0700 | [diff] [blame] | 151 | log2-depth = <5>; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 152 | }; |
| 153 | |
| 154 | leds { |
| 155 | compatible = "gpio-leds"; |
| 156 | |
| 157 | iracibble { |
| 158 | gpios = <&gpio_a 1 0>; |
| 159 | label = "sandbox:red"; |
| 160 | }; |
| 161 | |
| 162 | martinet { |
| 163 | gpios = <&gpio_a 2 0>; |
| 164 | label = "sandbox:green"; |
| 165 | }; |
| 166 | }; |
| 167 | |
Tom Rini | 4a3ca48 | 2020-02-11 12:41:23 -0500 | [diff] [blame] | 168 | pci@0 { |
Simon Glass | 8c50102 | 2019-12-06 21:41:54 -0700 | [diff] [blame] | 169 | pci@1e,0 { |
| 170 | compatible = "sandbox,pmc"; |
| 171 | reg = <0xf000 0 0 0 0>; |
| 172 | sandbox,emul = <&pmc_emul>; |
| 173 | gpe0-dwx-mask = <0xf>; |
| 174 | gpe0-dwx-shift-base = <4>; |
| 175 | gpe0-dw = <6 7 9>; |
| 176 | gpe0-sts = <0x20>; |
| 177 | gpe0-en = <0x30>; |
| 178 | }; |
| 179 | |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 180 | pci@1f,0 { |
| 181 | compatible = "pci-generic"; |
| 182 | reg = <0xf800 0 0 0 0>; |
Simon Glass | b98ba4c | 2019-09-25 08:56:10 -0600 | [diff] [blame] | 183 | sandbox,emul = <&swap_case_emul>; |
| 184 | }; |
| 185 | }; |
| 186 | |
| 187 | emul { |
| 188 | compatible = "sandbox,pci-emul-parent"; |
Simon Glass | 8c50102 | 2019-12-06 21:41:54 -0700 | [diff] [blame] | 189 | pmc_emul: emul@1e,0 { |
| 190 | compatible = "sandbox,pmc-emul"; |
| 191 | }; |
Simon Glass | b98ba4c | 2019-09-25 08:56:10 -0600 | [diff] [blame] | 192 | swap_case_emul: emul@1f,0 { |
| 193 | compatible = "sandbox,swap-case"; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 194 | }; |
| 195 | }; |
| 196 | |
| 197 | pinctrl { |
| 198 | compatible = "sandbox,pinctrl"; |
| 199 | status = "okay"; |
| 200 | |
| 201 | pinctrl_i2c0: i2c0 { |
| 202 | groups = "i2c"; |
| 203 | function = "i2c"; |
| 204 | bias-pull-up; |
| 205 | }; |
| 206 | |
| 207 | pinctrl_serial0: uart0 { |
| 208 | groups = "serial_a"; |
| 209 | function = "serial"; |
| 210 | }; |
| 211 | |
| 212 | pinctrl_onewire0: onewire0 { |
| 213 | groups = "w1"; |
| 214 | function = "w1"; |
| 215 | bias-pull-up; |
| 216 | }; |
| 217 | }; |
| 218 | |
| 219 | reset@1 { |
| 220 | compatible = "sandbox,reset"; |
| 221 | }; |
| 222 | |
Vincent Stehlé | 53f6dc0 | 2021-03-10 15:33:30 +0100 | [diff] [blame] | 223 | rng { |
| 224 | compatible = "sandbox,sandbox-rng"; |
| 225 | }; |
| 226 | |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 227 | sound { |
| 228 | compatible = "sandbox,sound"; |
| 229 | cpu { |
| 230 | sound-dai = <&i2s 0>; |
| 231 | }; |
| 232 | |
| 233 | codec { |
| 234 | sound-dai = <&audio 0>; |
| 235 | }; |
| 236 | }; |
| 237 | |
| 238 | spi@0 { |
| 239 | firmware_storage_spi: flash@0 { |
Simon Glass | e98524a | 2020-12-19 10:39:56 -0700 | [diff] [blame] | 240 | u-boot,dm-pre-proper; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 241 | reg = <0>; |
Simon Glass | 7e36868 | 2019-05-18 11:59:49 -0600 | [diff] [blame] | 242 | compatible = "spansion,m25p16", "jedec,spi-nor"; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 243 | spi-max-frequency = <40000000>; |
| 244 | sandbox,filename = "spi.bin"; |
| 245 | }; |
| 246 | }; |
| 247 | |
| 248 | spl-test { |
| 249 | u-boot,dm-pre-reloc; |
| 250 | compatible = "sandbox,spl-test"; |
| 251 | boolval; |
| 252 | intval = <1>; |
| 253 | intarray = <2 3 4>; |
Simon Glass | 4311832 | 2021-07-28 19:23:11 -0600 | [diff] [blame] | 254 | maybe-empty-int = <>; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 255 | byteval = [05]; |
| 256 | bytearray = [06]; |
| 257 | longbytearray = [09 0a 0b 0c 0d 0e 0f 10 11]; |
| 258 | stringval = "message"; |
| 259 | stringarray = "multi-word", "message"; |
| 260 | }; |
| 261 | |
| 262 | spl-test2 { |
| 263 | u-boot,dm-pre-reloc; |
| 264 | compatible = "sandbox,spl-test"; |
| 265 | intval = <3>; |
| 266 | intarray = <5>; |
| 267 | byteval = [08]; |
| 268 | bytearray = [01 23 34]; |
| 269 | longbytearray = [09 0a 0b 0c]; |
| 270 | stringval = "message2"; |
| 271 | stringarray = "another", "multi-word", "message"; |
| 272 | }; |
| 273 | |
| 274 | spl-test3 { |
| 275 | u-boot,dm-pre-reloc; |
| 276 | compatible = "sandbox,spl-test"; |
| 277 | stringarray = "one"; |
Simon Glass | 4311832 | 2021-07-28 19:23:11 -0600 | [diff] [blame] | 278 | maybe-empty-int = <1>; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 279 | }; |
| 280 | |
Patrick Delaunay | ae84ff1 | 2019-05-21 19:19:11 +0200 | [diff] [blame] | 281 | spl-test5 { |
| 282 | u-boot,dm-tpl; |
| 283 | compatible = "sandbox,spl-test"; |
| 284 | stringarray = "tpl"; |
| 285 | }; |
| 286 | |
| 287 | spl-test6 { |
| 288 | u-boot,dm-pre-proper; |
| 289 | compatible = "sandbox,spl-test"; |
| 290 | stringarray = "pre-proper"; |
| 291 | }; |
| 292 | |
Simon Glass | 77faa97 | 2021-03-15 17:25:31 +1300 | [diff] [blame] | 293 | spl-test7 { |
Patrick Delaunay | ae84ff1 | 2019-05-21 19:19:11 +0200 | [diff] [blame] | 294 | u-boot,dm-spl; |
Simon Glass | 77faa97 | 2021-03-15 17:25:31 +1300 | [diff] [blame] | 295 | compatible = "sandbox,spl-test"; |
| 296 | stringarray = "spl"; |
Patrick Delaunay | ae84ff1 | 2019-05-21 19:19:11 +0200 | [diff] [blame] | 297 | }; |
| 298 | |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 299 | square { |
| 300 | compatible = "demo-shape"; |
| 301 | colour = "blue"; |
| 302 | sides = <4>; |
| 303 | }; |
| 304 | |
| 305 | timer { |
| 306 | compatible = "sandbox,timer"; |
| 307 | clock-frequency = <1000000>; |
| 308 | }; |
| 309 | |
| 310 | tpm { |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 311 | compatible = "google,sandbox-tpm"; |
| 312 | }; |
| 313 | |
| 314 | tpm2 { |
| 315 | compatible = "sandbox,tpm2"; |
| 316 | }; |
| 317 | |
| 318 | triangle { |
| 319 | compatible = "demo-shape"; |
| 320 | colour = "cyan"; |
| 321 | sides = <3>; |
| 322 | character = <83>; |
| 323 | light-gpios = <&gpio_a 2>, <&gpio_b 6 0>; |
| 324 | }; |
| 325 | |
| 326 | /* Needs to be available prior to relocation */ |
| 327 | uart0: serial { |
| 328 | u-boot,dm-spl; |
| 329 | compatible = "sandbox,serial"; |
| 330 | sandbox,text-colour = "cyan"; |
| 331 | pinctrl-names = "default"; |
| 332 | pinctrl-0 = <&pinctrl_serial0>; |
| 333 | }; |
| 334 | |
| 335 | usb@0 { |
| 336 | compatible = "sandbox,usb"; |
| 337 | status = "disabled"; |
| 338 | hub { |
| 339 | compatible = "sandbox,usb-hub"; |
| 340 | #address-cells = <1>; |
| 341 | #size-cells = <0>; |
| 342 | flash-stick { |
| 343 | reg = <0>; |
| 344 | compatible = "sandbox,usb-flash"; |
| 345 | }; |
| 346 | }; |
| 347 | }; |
| 348 | |
| 349 | usb@1 { |
| 350 | compatible = "sandbox,usb"; |
| 351 | hub { |
| 352 | compatible = "usb-hub"; |
| 353 | usb,device-class = <USB_CLASS_HUB>; |
| 354 | hub-emul { |
| 355 | compatible = "sandbox,usb-hub"; |
| 356 | #address-cells = <1>; |
| 357 | #size-cells = <0>; |
| 358 | flash-stick { |
| 359 | reg = <0>; |
| 360 | compatible = "sandbox,usb-flash"; |
| 361 | sandbox,filepath = "flash.bin"; |
| 362 | }; |
| 363 | }; |
| 364 | }; |
| 365 | }; |
| 366 | |
| 367 | usb@2 { |
| 368 | compatible = "sandbox,usb"; |
| 369 | status = "disabled"; |
| 370 | }; |
| 371 | |
| 372 | spmi: spmi@0 { |
| 373 | compatible = "sandbox,spmi"; |
| 374 | #address-cells = <0x1>; |
| 375 | #size-cells = <0x1>; |
| 376 | pm8916@0 { |
| 377 | compatible = "qcom,spmi-pmic"; |
| 378 | reg = <0x0 0x1>; |
| 379 | #address-cells = <0x1>; |
| 380 | #size-cells = <0x1>; |
| 381 | |
| 382 | spmi_gpios: gpios@c000 { |
| 383 | compatible = "qcom,pm8916-gpio"; |
| 384 | reg = <0xc000 0x400>; |
| 385 | gpio-controller; |
| 386 | gpio-count = <4>; |
| 387 | #gpio-cells = <2>; |
| 388 | gpio-bank-name="spmi"; |
| 389 | }; |
| 390 | }; |
| 391 | }; |
| 392 | |
| 393 | axi: axi@0 { |
| 394 | compatible = "sandbox,axi"; |
| 395 | #address-cells = <0x1>; |
| 396 | #size-cells = <0x1>; |
| 397 | store@0 { |
| 398 | compatible = "sandbox,sandbox_store"; |
| 399 | reg = <0x0 0x400>; |
| 400 | }; |
| 401 | }; |
| 402 | |
| 403 | onewire0: onewire { |
| 404 | compatible = "w1-gpio"; |
| 405 | gpios = <&gpio_a 8>; |
| 406 | pinctrl-names = "default"; |
| 407 | pinctrl-0 = <&pinctrl_onewire0>; |
| 408 | status = "okay"; |
| 409 | |
| 410 | sandbox_eeprom0: sandbox_eeprom@0 { |
| 411 | compatible = "sandbox,w1-eeprom"; |
| 412 | status = "okay"; |
| 413 | }; |
| 414 | }; |
| 415 | |
| 416 | sandbox_tee { |
| 417 | compatible = "sandbox,tee"; |
| 418 | }; |
| 419 | }; |
| 420 | |
| 421 | &cros_ec { |
| 422 | /* |
| 423 | * This describes the flash memory within the EC. Note |
| 424 | * that the STM32L flash erases to 0, not 0xff. |
| 425 | */ |
| 426 | flash { |
| 427 | image-pos = <0x08000000>; |
| 428 | size = <0x20000>; |
| 429 | erase-value = <0>; |
| 430 | |
| 431 | /* Information for sandbox */ |
| 432 | ro { |
| 433 | image-pos = <0>; |
| 434 | size = <0xf000>; |
| 435 | }; |
| 436 | wp-ro { |
| 437 | image-pos = <0xf000>; |
| 438 | size = <0x1000>; |
| 439 | }; |
| 440 | rw { |
| 441 | image-pos = <0x10000>; |
| 442 | size = <0x10000>; |
| 443 | }; |
| 444 | }; |
| 445 | |
| 446 | keyboard-controller { |
Simon Glass | e98524a | 2020-12-19 10:39:56 -0700 | [diff] [blame] | 447 | u-boot,dm-pre-proper; |
Simon Glass | 28db469 | 2019-05-18 11:59:41 -0600 | [diff] [blame] | 448 | }; |
| 449 | }; |