Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'aspeed-5.13-lpc' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc into arm/drivers

ASPEED LPC updates for 5.13

These patches fix the ASPEED LPC bindings and LPC-related device drivers
so in the future the KCS driver can properly use the hardware.

* tag 'aspeed-5.13-lpc' of git://git.kernel.org/pub/scm/linux/kernel/git/joel/bmc:
soc: aspeed: Adapt to new LPC device tree layout
pinctrl: aspeed-g5: Adapt to new LPC device tree layout
ipmi: kcs: aspeed: Adapt to new LPC DTS layout
ARM: dts: Remove LPC BMC and Host partitions
dt-bindings: aspeed-lpc: Remove LPC partitioning

Link: https://lore.kernel.org/r/CACPK8Xcb12LsVr7CUaXXjQskKbVjb7x+jgueG1Hik-kBPWtDSg@mail.gmail.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

+214 -287
+25 -75
Documentation/devicetree/bindings/mfd/aspeed-lpc.txt
··· 9 9 conditions it can also take the role of bus master. 10 10 11 11 The LPC controller is represented as a multi-function device to account for the 12 - mix of functionality it provides. The principle split is between the register 13 - layout at the start of the I/O space which is, to quote the Aspeed datasheet, 14 - "basically compatible with the [LPC registers from the] popular BMC controller 15 - H8S/2168[1]", and everything else, where everything else is an eclectic 16 - collection of functions with a esoteric register layout. "Everything else", 17 - here labeled the "host" portion of the controller, includes, but is not limited 18 - to: 12 + mix of functionality, which includes, but is not limited to: 19 13 20 14 * An IPMI Block Transfer[2] Controller 21 15 ··· 38 44 =================== 39 45 40 46 - compatible: One of: 41 - "aspeed,ast2400-lpc", "simple-mfd" 42 - "aspeed,ast2500-lpc", "simple-mfd" 43 - "aspeed,ast2600-lpc", "simple-mfd" 47 + "aspeed,ast2400-lpc-v2", "simple-mfd", "syscon" 48 + "aspeed,ast2500-lpc-v2", "simple-mfd", "syscon" 49 + "aspeed,ast2600-lpc-v2", "simple-mfd", "syscon" 44 50 45 51 - reg: contains the physical address and length values of the Aspeed 46 52 LPC memory region. 47 53 48 54 - #address-cells: <1> 49 55 - #size-cells: <1> 50 - - ranges: Maps 0 to the physical address and length of the LPC memory 51 - region 52 - 53 - Required LPC Child nodes 54 - ======================== 55 - 56 - BMC Node 57 - -------- 58 - 59 - - compatible: One of: 60 - "aspeed,ast2400-lpc-bmc" 61 - "aspeed,ast2500-lpc-bmc" 62 - "aspeed,ast2600-lpc-bmc" 63 - 64 - - reg: contains the physical address and length values of the 65 - H8S/2168-compatible LPC controller memory region 66 - 67 - Host Node 68 - --------- 69 - 70 - - compatible: One of: 71 - "aspeed,ast2400-lpc-host", "simple-mfd", "syscon" 72 - "aspeed,ast2500-lpc-host", "simple-mfd", "syscon" 73 - "aspeed,ast2600-lpc-host", "simple-mfd", "syscon" 74 - 75 - - reg: contains the address and length values of the host-related 76 - register space for the Aspeed LPC controller 77 - 78 - - #address-cells: <1> 79 - - #size-cells: <1> 80 - - ranges: Maps 0 to the address and length of the host-related LPC memory 56 + - ranges: Maps 0 to the physical address and length of the LPC memory 81 57 region 82 58 83 59 Example: 84 60 85 61 lpc: lpc@1e789000 { 86 - compatible = "aspeed,ast2500-lpc", "simple-mfd"; 62 + compatible = "aspeed,ast2500-lpc-v2", "simple-mfd", "syscon"; 87 63 reg = <0x1e789000 0x1000>; 88 64 89 65 #address-cells = <1>; 90 66 #size-cells = <1>; 91 67 ranges = <0x0 0x1e789000 0x1000>; 92 68 93 - lpc_bmc: lpc-bmc@0 { 94 - compatible = "aspeed,ast2500-lpc-bmc"; 69 + lpc_snoop: lpc-snoop@0 { 70 + compatible = "aspeed,ast2600-lpc-snoop"; 95 71 reg = <0x0 0x80>; 96 - }; 97 - 98 - lpc_host: lpc-host@80 { 99 - compatible = "aspeed,ast2500-lpc-host", "simple-mfd", "syscon"; 100 - reg = <0x80 0x1e0>; 101 - reg-io-width = <4>; 102 - 103 - #address-cells = <1>; 104 - #size-cells = <1>; 105 - ranges = <0x0 0x80 0x1e0>; 72 + interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; 73 + snoop-ports = <0x80>; 106 74 }; 107 75 }; 108 76 109 - BMC Node Children 110 - ================== 111 - 112 - 113 - Host Node Children 114 - ================== 115 77 116 78 LPC Host Interface Controller 117 79 ------------------- ··· 99 149 100 150 Example: 101 151 102 - lpc-host@80 { 103 - lpc_ctrl: lpc-ctrl@0 { 104 - compatible = "aspeed,ast2500-lpc-ctrl"; 105 - reg = <0x0 0x80>; 106 - clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 107 - memory-region = <&flash_memory>; 108 - flash = <&spi>; 109 - }; 152 + lpc_ctrl: lpc-ctrl@80 { 153 + compatible = "aspeed,ast2500-lpc-ctrl"; 154 + reg = <0x80 0x80>; 155 + clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 156 + memory-region = <&flash_memory>; 157 + flash = <&spi>; 110 158 }; 111 159 112 160 LPC Host Controller ··· 127 179 128 180 Example: 129 181 130 - lhc: lhc@20 { 182 + lhc: lhc@a0 { 131 183 compatible = "aspeed,ast2500-lhc"; 132 - reg = <0x20 0x24 0x48 0x8>; 184 + reg = <0xa0 0x24 0xc8 0x8>; 133 185 }; 134 186 135 187 LPC reset control ··· 140 192 141 193 Required properties: 142 194 143 - - compatible: "aspeed,ast2600-lpc-reset" or 144 - "aspeed,ast2500-lpc-reset" 145 - "aspeed,ast2400-lpc-reset" 195 + - compatible: One of: 196 + "aspeed,ast2600-lpc-reset"; 197 + "aspeed,ast2500-lpc-reset"; 198 + "aspeed,ast2400-lpc-reset"; 199 + 146 200 - reg: offset and length of the IP in the LHC memory region 147 201 - #reset-controller indicates the number of reset cells expected 148 202 149 203 Example: 150 204 151 - lpc_reset: reset-controller@18 { 205 + lpc_reset: reset-controller@98 { 152 206 compatible = "aspeed,ast2500-lpc-reset"; 153 - reg = <0x18 0x4>; 207 + reg = <0x98 0x4>; 154 208 #reset-cells = <1>; 155 209 };
+28 -42
arch/arm/boot/dts/aspeed-g4.dtsi
··· 343 343 }; 344 344 345 345 lpc: lpc@1e789000 { 346 - compatible = "aspeed,ast2400-lpc", "simple-mfd"; 346 + compatible = "aspeed,ast2400-lpc-v2", "simple-mfd", "syscon"; 347 347 reg = <0x1e789000 0x1000>; 348 + reg-io-width = <4>; 348 349 349 350 #address-cells = <1>; 350 351 #size-cells = <1>; 351 352 ranges = <0x0 0x1e789000 0x1000>; 352 353 353 - lpc_bmc: lpc-bmc@0 { 354 - compatible = "aspeed,ast2400-lpc-bmc"; 355 - reg = <0x0 0x80>; 354 + lpc_ctrl: lpc-ctrl@80 { 355 + compatible = "aspeed,ast2400-lpc-ctrl"; 356 + reg = <0x80 0x10>; 357 + clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 358 + status = "disabled"; 356 359 }; 357 360 358 - lpc_host: lpc-host@80 { 359 - compatible = "aspeed,ast2400-lpc-host", "simple-mfd", "syscon"; 360 - reg = <0x80 0x1e0>; 361 - reg-io-width = <4>; 361 + lpc_snoop: lpc-snoop@90 { 362 + compatible = "aspeed,ast2400-lpc-snoop"; 363 + reg = <0x90 0x8>; 364 + interrupts = <8>; 365 + clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 366 + status = "disabled"; 367 + }; 362 368 363 - #address-cells = <1>; 364 - #size-cells = <1>; 365 - ranges = <0x0 0x80 0x1e0>; 369 + lhc: lhc@a0 { 370 + compatible = "aspeed,ast2400-lhc"; 371 + reg = <0xa0 0x24 0xc8 0x8>; 372 + }; 366 373 367 - lpc_ctrl: lpc-ctrl@0 { 368 - compatible = "aspeed,ast2400-lpc-ctrl"; 369 - reg = <0x0 0x10>; 370 - clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 371 - status = "disabled"; 372 - }; 374 + lpc_reset: reset-controller@98 { 375 + compatible = "aspeed,ast2400-lpc-reset"; 376 + reg = <0x98 0x4>; 377 + #reset-cells = <1>; 378 + }; 373 379 374 - lpc_snoop: lpc-snoop@10 { 375 - compatible = "aspeed,ast2400-lpc-snoop"; 376 - reg = <0x10 0x8>; 377 - interrupts = <8>; 378 - clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 379 - status = "disabled"; 380 - }; 381 - 382 - lhc: lhc@20 { 383 - compatible = "aspeed,ast2400-lhc"; 384 - reg = <0x20 0x24 0x48 0x8>; 385 - }; 386 - 387 - lpc_reset: reset-controller@18 { 388 - compatible = "aspeed,ast2400-lpc-reset"; 389 - reg = <0x18 0x4>; 390 - #reset-cells = <1>; 391 - }; 392 - 393 - ibt: ibt@c0 { 394 - compatible = "aspeed,ast2400-ibt-bmc"; 395 - reg = <0xc0 0x18>; 396 - interrupts = <8>; 397 - status = "disabled"; 398 - }; 380 + ibt: ibt@140 { 381 + compatible = "aspeed,ast2400-ibt-bmc"; 382 + reg = <0x140 0x18>; 383 + interrupts = <8>; 384 + status = "disabled"; 399 385 }; 400 386 }; 401 387
+52 -69
arch/arm/boot/dts/aspeed-g5.dtsi
··· 434 434 }; 435 435 436 436 lpc: lpc@1e789000 { 437 - compatible = "aspeed,ast2500-lpc", "simple-mfd"; 437 + compatible = "aspeed,ast2500-lpc-v2", "simple-mfd", "syscon"; 438 438 reg = <0x1e789000 0x1000>; 439 + reg-io-width = <4>; 439 440 440 441 #address-cells = <1>; 441 442 #size-cells = <1>; 442 443 ranges = <0x0 0x1e789000 0x1000>; 443 444 444 - lpc_bmc: lpc-bmc@0 { 445 - compatible = "aspeed,ast2500-lpc-bmc", "simple-mfd", "syscon"; 446 - reg = <0x0 0x80>; 447 - reg-io-width = <4>; 448 - 449 - #address-cells = <1>; 450 - #size-cells = <1>; 451 - ranges = <0x0 0x0 0x80>; 452 - 453 - kcs1: kcs@24 { 454 - compatible = "aspeed,ast2500-kcs-bmc-v2"; 455 - reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>; 456 - interrupts = <8>; 457 - status = "disabled"; 458 - }; 459 - kcs2: kcs@28 { 460 - compatible = "aspeed,ast2500-kcs-bmc-v2"; 461 - reg = <0x28 0x1>, <0x34 0x1>, <0x40 0x1>; 462 - interrupts = <8>; 463 - status = "disabled"; 464 - }; 465 - kcs3: kcs@2c { 466 - compatible = "aspeed,ast2500-kcs-bmc-v2"; 467 - reg = <0x2c 0x1>, <0x38 0x1>, <0x44 0x1>; 468 - interrupts = <8>; 469 - status = "disabled"; 470 - }; 445 + kcs1: kcs@24 { 446 + compatible = "aspeed,ast2500-kcs-bmc-v2"; 447 + reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>; 448 + interrupts = <8>; 449 + status = "disabled"; 471 450 }; 472 451 473 - lpc_host: lpc-host@80 { 474 - compatible = "aspeed,ast2500-lpc-host", "simple-mfd", "syscon"; 475 - reg = <0x80 0x1e0>; 476 - reg-io-width = <4>; 452 + kcs2: kcs@28 { 453 + compatible = "aspeed,ast2500-kcs-bmc-v2"; 454 + reg = <0x28 0x1>, <0x34 0x1>, <0x40 0x1>; 455 + interrupts = <8>; 456 + status = "disabled"; 457 + }; 477 458 478 - #address-cells = <1>; 479 - #size-cells = <1>; 480 - ranges = <0x0 0x80 0x1e0>; 459 + kcs3: kcs@2c { 460 + compatible = "aspeed,ast2500-kcs-bmc-v2"; 461 + reg = <0x2c 0x1>, <0x38 0x1>, <0x44 0x1>; 462 + interrupts = <8>; 463 + status = "disabled"; 464 + }; 481 465 482 - kcs4: kcs@94 { 483 - compatible = "aspeed,ast2500-kcs-bmc-v2"; 484 - reg = <0x94 0x1>, <0x98 0x1>, <0x9c 0x1>; 485 - interrupts = <8>; 486 - status = "disabled"; 487 - }; 466 + kcs4: kcs@114 { 467 + compatible = "aspeed,ast2500-kcs-bmc-v2"; 468 + reg = <0x114 0x1>, <0x118 0x1>, <0x11c 0x1>; 469 + interrupts = <8>; 470 + status = "disabled"; 471 + }; 488 472 489 - lpc_ctrl: lpc-ctrl@0 { 490 - compatible = "aspeed,ast2500-lpc-ctrl"; 491 - reg = <0x0 0x10>; 492 - clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 493 - status = "disabled"; 494 - }; 473 + lpc_ctrl: lpc-ctrl@80 { 474 + compatible = "aspeed,ast2500-lpc-ctrl"; 475 + reg = <0x80 0x10>; 476 + clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 477 + status = "disabled"; 478 + }; 495 479 496 - lpc_snoop: lpc-snoop@10 { 497 - compatible = "aspeed,ast2500-lpc-snoop"; 498 - reg = <0x10 0x8>; 499 - interrupts = <8>; 500 - clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 501 - status = "disabled"; 502 - }; 480 + lpc_snoop: lpc-snoop@90 { 481 + compatible = "aspeed,ast2500-lpc-snoop"; 482 + reg = <0x90 0x8>; 483 + interrupts = <8>; 484 + clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 485 + status = "disabled"; 486 + }; 503 487 504 - lpc_reset: reset-controller@18 { 505 - compatible = "aspeed,ast2500-lpc-reset"; 506 - reg = <0x18 0x4>; 507 - #reset-cells = <1>; 508 - }; 488 + lpc_reset: reset-controller@98 { 489 + compatible = "aspeed,ast2500-lpc-reset"; 490 + reg = <0x98 0x4>; 491 + #reset-cells = <1>; 492 + }; 509 493 510 - lhc: lhc@20 { 511 - compatible = "aspeed,ast2500-lhc"; 512 - reg = <0x20 0x24 0x48 0x8>; 513 - }; 494 + lhc: lhc@a0 { 495 + compatible = "aspeed,ast2500-lhc"; 496 + reg = <0xa0 0x24 0xc8 0x8>; 497 + }; 514 498 515 499 516 - ibt: ibt@c0 { 517 - compatible = "aspeed,ast2500-ibt-bmc"; 518 - reg = <0xc0 0x18>; 519 - interrupts = <8>; 520 - status = "disabled"; 521 - }; 500 + ibt: ibt@140 { 501 + compatible = "aspeed,ast2500-ibt-bmc"; 502 + reg = <0x140 0x18>; 503 + interrupts = <8>; 504 + status = "disabled"; 522 505 }; 523 506 }; 524 507
+53 -70
arch/arm/boot/dts/aspeed-g6.dtsi
··· 460 460 }; 461 461 462 462 lpc: lpc@1e789000 { 463 - compatible = "aspeed,ast2600-lpc", "simple-mfd"; 463 + compatible = "aspeed,ast2600-lpc-v2", "simple-mfd", "syscon"; 464 464 reg = <0x1e789000 0x1000>; 465 + reg-io-width = <4>; 465 466 466 467 #address-cells = <1>; 467 468 #size-cells = <1>; 468 469 ranges = <0x0 0x1e789000 0x1000>; 469 470 470 - lpc_bmc: lpc-bmc@0 { 471 - compatible = "aspeed,ast2600-lpc-bmc", "simple-mfd", "syscon"; 472 - reg = <0x0 0x80>; 473 - reg-io-width = <4>; 474 - 475 - #address-cells = <1>; 476 - #size-cells = <1>; 477 - ranges = <0x0 0x0 0x80>; 478 - 479 - kcs1: kcs@24 { 480 - compatible = "aspeed,ast2500-kcs-bmc-v2"; 481 - reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>; 482 - interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>; 483 - kcs_chan = <1>; 484 - status = "disabled"; 485 - }; 486 - kcs2: kcs@28 { 487 - compatible = "aspeed,ast2500-kcs-bmc-v2"; 488 - reg = <0x28 0x1>, <0x34 0x1>, <0x40 0x1>; 489 - interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>; 490 - status = "disabled"; 491 - }; 492 - kcs3: kcs@2c { 493 - compatible = "aspeed,ast2500-kcs-bmc-v2"; 494 - reg = <0x2c 0x1>, <0x38 0x1>, <0x44 0x1>; 495 - interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>; 496 - status = "disabled"; 497 - }; 471 + kcs1: kcs@24 { 472 + compatible = "aspeed,ast2500-kcs-bmc-v2"; 473 + reg = <0x24 0x1>, <0x30 0x1>, <0x3c 0x1>; 474 + interrupts = <GIC_SPI 138 IRQ_TYPE_LEVEL_HIGH>; 475 + kcs_chan = <1>; 476 + status = "disabled"; 498 477 }; 499 478 500 - lpc_host: lpc-host@80 { 501 - compatible = "aspeed,ast2600-lpc-host", "simple-mfd", "syscon"; 502 - reg = <0x80 0x1e0>; 503 - reg-io-width = <4>; 479 + kcs2: kcs@28 { 480 + compatible = "aspeed,ast2500-kcs-bmc-v2"; 481 + reg = <0x28 0x1>, <0x34 0x1>, <0x40 0x1>; 482 + interrupts = <GIC_SPI 139 IRQ_TYPE_LEVEL_HIGH>; 483 + status = "disabled"; 484 + }; 504 485 505 - #address-cells = <1>; 506 - #size-cells = <1>; 507 - ranges = <0x0 0x80 0x1e0>; 486 + kcs3: kcs@2c { 487 + compatible = "aspeed,ast2500-kcs-bmc-v2"; 488 + reg = <0x2c 0x1>, <0x38 0x1>, <0x44 0x1>; 489 + interrupts = <GIC_SPI 140 IRQ_TYPE_LEVEL_HIGH>; 490 + status = "disabled"; 491 + }; 508 492 509 - kcs4: kcs@94 { 510 - compatible = "aspeed,ast2500-kcs-bmc-v2"; 511 - reg = <0x94 0x1>, <0x98 0x1>, <0x9c 0x1>; 512 - interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; 513 - status = "disabled"; 514 - }; 493 + kcs4: kcs@114 { 494 + compatible = "aspeed,ast2500-kcs-bmc-v2"; 495 + reg = <0x114 0x1>, <0x118 0x1>, <0x11c 0x1>; 496 + interrupts = <GIC_SPI 141 IRQ_TYPE_LEVEL_HIGH>; 497 + status = "disabled"; 498 + }; 515 499 516 - lpc_ctrl: lpc-ctrl@0 { 517 - compatible = "aspeed,ast2600-lpc-ctrl"; 518 - reg = <0x0 0x80>; 519 - clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 520 - status = "disabled"; 521 - }; 500 + lpc_ctrl: lpc-ctrl@80 { 501 + compatible = "aspeed,ast2600-lpc-ctrl"; 502 + reg = <0x80 0x80>; 503 + clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 504 + status = "disabled"; 505 + }; 522 506 523 - lpc_snoop: lpc-snoop@0 { 524 - compatible = "aspeed,ast2600-lpc-snoop"; 525 - reg = <0x0 0x80>; 526 - interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; 527 - clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 528 - status = "disabled"; 529 - }; 507 + lpc_snoop: lpc-snoop@80 { 508 + compatible = "aspeed,ast2600-lpc-snoop"; 509 + reg = <0x80 0x80>; 510 + interrupts = <GIC_SPI 144 IRQ_TYPE_LEVEL_HIGH>; 511 + clocks = <&syscon ASPEED_CLK_GATE_LCLK>; 512 + status = "disabled"; 513 + }; 530 514 531 - lhc: lhc@20 { 532 - compatible = "aspeed,ast2600-lhc"; 533 - reg = <0x20 0x24 0x48 0x8>; 534 - }; 515 + lhc: lhc@a0 { 516 + compatible = "aspeed,ast2600-lhc"; 517 + reg = <0xa0 0x24 0xc8 0x8>; 518 + }; 535 519 536 - lpc_reset: reset-controller@18 { 537 - compatible = "aspeed,ast2600-lpc-reset"; 538 - reg = <0x18 0x4>; 539 - #reset-cells = <1>; 540 - }; 520 + lpc_reset: reset-controller@98 { 521 + compatible = "aspeed,ast2600-lpc-reset"; 522 + reg = <0x98 0x4>; 523 + #reset-cells = <1>; 524 + }; 541 525 542 - ibt: ibt@c0 { 543 - compatible = "aspeed,ast2600-ibt-bmc"; 544 - reg = <0xc0 0x18>; 545 - interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; 546 - status = "disabled"; 547 - }; 526 + ibt: ibt@140 { 527 + compatible = "aspeed,ast2600-ibt-bmc"; 528 + reg = <0x140 0x18>; 529 + interrupts = <GIC_SPI 143 IRQ_TYPE_LEVEL_HIGH>; 530 + status = "disabled"; 548 531 }; 549 532 }; 550 533
+16 -11
drivers/char/ipmi/kcs_bmc_aspeed.c
··· 27 27 28 28 #define KCS_CHANNEL_MAX 4 29 29 30 - /* mapped to lpc-bmc@0 IO space */ 31 30 #define LPC_HICR0 0x000 32 31 #define LPC_HICR0_LPC3E BIT(7) 33 32 #define LPC_HICR0_LPC2E BIT(6) ··· 51 52 #define LPC_STR1 0x03C 52 53 #define LPC_STR2 0x040 53 54 #define LPC_STR3 0x044 54 - 55 - /* mapped to lpc-host@80 IO space */ 56 - #define LPC_HICRB 0x080 55 + #define LPC_HICRB 0x100 57 56 #define LPC_HICRB_IBFIF4 BIT(1) 58 57 #define LPC_HICRB_LPC4E BIT(0) 59 - #define LPC_LADR4 0x090 60 - #define LPC_IDR4 0x094 61 - #define LPC_ODR4 0x098 62 - #define LPC_STR4 0x09C 58 + #define LPC_LADR4 0x110 59 + #define LPC_IDR4 0x114 60 + #define LPC_ODR4 0x118 61 + #define LPC_STR4 0x11C 63 62 64 63 struct aspeed_kcs_bmc { 65 64 struct regmap *map; ··· 345 348 struct device_node *np; 346 349 int rc; 347 350 348 - np = pdev->dev.of_node; 351 + np = dev->of_node->parent; 352 + if (!of_device_is_compatible(np, "aspeed,ast2400-lpc-v2") && 353 + !of_device_is_compatible(np, "aspeed,ast2500-lpc-v2") && 354 + !of_device_is_compatible(np, "aspeed,ast2600-lpc-v2")) { 355 + dev_err(dev, "unsupported LPC device binding\n"); 356 + return -ENODEV; 357 + } 358 + 359 + np = dev->of_node; 349 360 if (of_device_is_compatible(np, "aspeed,ast2400-kcs-bmc") || 350 - of_device_is_compatible(np, "aspeed,ast2500-kcs-bmc")) 361 + of_device_is_compatible(np, "aspeed,ast2500-kcs-bmc")) 351 362 kcs_bmc = aspeed_kcs_probe_of_v1(pdev); 352 363 else if (of_device_is_compatible(np, "aspeed,ast2400-kcs-bmc-v2") || 353 - of_device_is_compatible(np, "aspeed,ast2500-kcs-bmc-v2")) 364 + of_device_is_compatible(np, "aspeed,ast2500-kcs-bmc-v2")) 354 365 kcs_bmc = aspeed_kcs_probe_of_v2(pdev); 355 366 else 356 367 return -EINVAL;
+11 -6
drivers/pinctrl/aspeed/pinctrl-aspeed-g5.c
··· 60 60 #define COND2 { ASPEED_IP_SCU, SCU94, GENMASK(1, 0), 0, 0 } 61 61 62 62 /* LHCR0 is offset from the end of the H8S/2168-compatible registers */ 63 - #define LHCR0 0x20 63 + #define LHCR0 0xa0 64 64 #define GFX064 0x64 65 65 66 66 #define B14 0 ··· 2648 2648 } 2649 2649 2650 2650 if (ip == ASPEED_IP_LPC) { 2651 - struct device_node *node; 2651 + struct device_node *np; 2652 2652 struct regmap *map; 2653 2653 2654 - node = of_parse_phandle(ctx->dev->of_node, 2654 + np = of_parse_phandle(ctx->dev->of_node, 2655 2655 "aspeed,external-nodes", 1); 2656 - if (node) { 2657 - map = syscon_node_to_regmap(node->parent); 2658 - of_node_put(node); 2656 + if (np) { 2657 + if (!of_device_is_compatible(np->parent, "aspeed,ast2400-lpc-v2") && 2658 + !of_device_is_compatible(np->parent, "aspeed,ast2500-lpc-v2") && 2659 + !of_device_is_compatible(np->parent, "aspeed,ast2600-lpc-v2")) 2660 + return ERR_PTR(-ENODEV); 2661 + 2662 + map = syscon_node_to_regmap(np->parent); 2663 + of_node_put(np); 2659 2664 if (IS_ERR(map)) 2660 2665 return map; 2661 2666 } else
+14 -6
drivers/soc/aspeed/aspeed-lpc-ctrl.c
··· 18 18 19 19 #define DEVICE_NAME "aspeed-lpc-ctrl" 20 20 21 - #define HICR5 0x0 21 + #define HICR5 0x80 22 22 #define HICR5_ENL2H BIT(8) 23 23 #define HICR5_ENFWH BIT(10) 24 24 25 - #define HICR6 0x4 25 + #define HICR6 0x84 26 26 #define SW_FWH2AHB BIT(17) 27 27 28 - #define HICR7 0x8 29 - #define HICR8 0xc 28 + #define HICR7 0x88 29 + #define HICR8 0x8c 30 30 31 31 struct aspeed_lpc_ctrl { 32 32 struct miscdevice miscdev; ··· 215 215 struct device_node *node; 216 216 struct resource resm; 217 217 struct device *dev; 218 + struct device_node *np; 218 219 int rc; 219 220 220 221 dev = &pdev->dev; ··· 271 270 } 272 271 } 273 272 274 - lpc_ctrl->regmap = syscon_node_to_regmap( 275 - pdev->dev.parent->of_node); 273 + np = pdev->dev.parent->of_node; 274 + if (!of_device_is_compatible(np, "aspeed,ast2400-lpc-v2") && 275 + !of_device_is_compatible(np, "aspeed,ast2500-lpc-v2") && 276 + !of_device_is_compatible(np, "aspeed,ast2600-lpc-v2")) { 277 + dev_err(dev, "unsupported LPC device binding\n"); 278 + return -ENODEV; 279 + } 280 + 281 + lpc_ctrl->regmap = syscon_node_to_regmap(np); 276 282 if (IS_ERR(lpc_ctrl->regmap)) { 277 283 dev_err(dev, "Couldn't get regmap\n"); 278 284 return -ENODEV;
+15 -8
drivers/soc/aspeed/aspeed-lpc-snoop.c
··· 29 29 #define NUM_SNOOP_CHANNELS 2 30 30 #define SNOOP_FIFO_SIZE 2048 31 31 32 - #define HICR5 0x0 32 + #define HICR5 0x80 33 33 #define HICR5_EN_SNP0W BIT(0) 34 34 #define HICR5_ENINT_SNP0W BIT(1) 35 35 #define HICR5_EN_SNP1W BIT(2) 36 36 #define HICR5_ENINT_SNP1W BIT(3) 37 - 38 - #define HICR6 0x4 37 + #define HICR6 0x84 39 38 #define HICR6_STR_SNP0W BIT(0) 40 39 #define HICR6_STR_SNP1W BIT(1) 41 - #define SNPWADR 0x10 40 + #define SNPWADR 0x90 42 41 #define SNPWADR_CH0_MASK GENMASK(15, 0) 43 42 #define SNPWADR_CH0_SHIFT 0 44 43 #define SNPWADR_CH1_MASK GENMASK(31, 16) 45 44 #define SNPWADR_CH1_SHIFT 16 46 - #define SNPWDR 0x14 45 + #define SNPWDR 0x94 47 46 #define SNPWDR_CH0_MASK GENMASK(7, 0) 48 47 #define SNPWDR_CH0_SHIFT 0 49 48 #define SNPWDR_CH1_MASK GENMASK(15, 8) 50 49 #define SNPWDR_CH1_SHIFT 8 51 - #define HICRB 0x80 50 + #define HICRB 0x100 52 51 #define HICRB_ENSNP0D BIT(14) 53 52 #define HICRB_ENSNP1D BIT(15) 54 53 ··· 259 260 { 260 261 struct aspeed_lpc_snoop *lpc_snoop; 261 262 struct device *dev; 263 + struct device_node *np; 262 264 u32 port; 263 265 int rc; 264 266 ··· 269 269 if (!lpc_snoop) 270 270 return -ENOMEM; 271 271 272 - lpc_snoop->regmap = syscon_node_to_regmap( 273 - pdev->dev.parent->of_node); 272 + np = pdev->dev.parent->of_node; 273 + if (!of_device_is_compatible(np, "aspeed,ast2400-lpc-v2") && 274 + !of_device_is_compatible(np, "aspeed,ast2500-lpc-v2") && 275 + !of_device_is_compatible(np, "aspeed,ast2600-lpc-v2")) { 276 + dev_err(dev, "unsupported LPC device binding\n"); 277 + return -ENODEV; 278 + } 279 + 280 + lpc_snoop->regmap = syscon_node_to_regmap(np); 274 281 if (IS_ERR(lpc_snoop->regmap)) { 275 282 dev_err(dev, "Couldn't get regmap\n"); 276 283 return -ENODEV;