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