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