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