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

Merge tag 'powerpc-6.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc updates from Michael Ellerman:

- Remove support for 40x CPUs & platforms

- Add support to the 64-bit BPF JIT for cpu v4 instructions

- Fix PCI hotplug driver crash on powernv

- Fix doorbell emulation for KVM on PAPR guests (nestedv2)

- Fix KVM nested guest handling of some less used SPRs

- Online NUMA nodes with no CPU/memory if they have a PCI device
attached

- Reduce memory overhead of enabling kfence on 64-bit Radix MMU kernels

- Reimplement the iommu table_group_ops for pseries for VFIO SPAPR TCE

Thanks to: Anjali K, Artem Savkov, Athira Rajeev, Breno Leitao, Brian
King, Celeste Liu, Christophe Leroy, Esben Haabendal, Gaurav Batra,
Gautam Menghani, Haren Myneni, Hari Bathini, Jeff Johnson, Krishna
Kumar, Krzysztof Kozlowski, Nathan Lynch, Nicholas Piggin, Nick Bowler,
Nilay Shroff, Rob Herring (Arm), Shawn Anastasio, Shivaprasad G Bhat,
Sourabh Jain, Srikar Dronamraju, Timothy Pearson, Uwe Kleine-König, and
Vaibhav Jain.

* tag 'powerpc-6.11-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (57 commits)
Documentation/powerpc: Mention 40x is removed
powerpc: Remove 40x leftovers
macintosh/therm_windtunnel: fix module unload.
powerpc: Check only single values are passed to CPU/MMU feature checks
powerpc/xmon: Fix disassembly CPU feature checks
powerpc: Drop clang workaround for builtin constant checks
powerpc64/bpf: jit support for signed division and modulo
powerpc64/bpf: jit support for sign extended mov
powerpc64/bpf: jit support for sign extended load
powerpc64/bpf: jit support for unconditional byte swap
powerpc64/bpf: jit support for 32bit offset jmp instruction
powerpc/pci: Hotplug driver bridge support
pci/hotplug/pnv_php: Fix hotplug driver crash on Powernv
powerpc/configs: Update defconfig with now user-visible CONFIG_FSL_IFC
powerpc: add missing MODULE_DESCRIPTION() macros
macintosh/mac_hid: add MODULE_DESCRIPTION()
KVM: PPC: add missing MODULE_DESCRIPTION() macros
powerpc/kexec: Use of_property_read_reg()
powerpc/64s/radix/kfence: map __kfence_pool at page granularity
powerpc/pseries/iommu: Define spapr_tce_table_group_ops only with CONFIG_IOMMU_API
...

+1465 -5777
-18
Documentation/arch/powerpc/cpu_families.rst
··· 128 128 - All 32 bit:: 129 129 130 130 +--------------+ 131 - | 401 | 132 - +--------------+ 133 - | 134 - | 135 - v 136 - +--------------+ 137 - | 403 | 138 - +--------------+ 139 - | 140 - | 141 - v 142 - +--------------+ 143 - | 405 | 144 - +--------------+ 145 - | 146 - | 147 - v 148 - +--------------+ 149 131 | 440 | 150 132 +--------------+ 151 133 |
+1
Documentation/arch/powerpc/elf_hwcaps.rst
··· 91 91 92 92 PPC_FEATURE_HAS_4xxMAC 93 93 The processor is 40x or 44x family. 94 + Unused in the kernel since 732b32daef80 ("powerpc: Remove core support for 40x") 94 95 95 96 PPC_FEATURE_UNIFIED_CACHE 96 97 The processor has a unified L1 cache for instructions and data, as
+3 -1
Documentation/arch/powerpc/kvm-nested.rst
··· 546 546 +--------+-------+----+--------+----------------------------------+ 547 547 | 0x1052 | 0x08 | RW | T | CTRL | 548 548 +--------+-------+----+--------+----------------------------------+ 549 - | 0x1053-| | | | Reserved | 549 + | 0x1053 | 0x08 | RW | T | DPDES | 550 + +--------+-------+----+--------+----------------------------------+ 551 + | 0x1054-| | | | Reserved | 550 552 | 0x1FFF | | | | | 551 553 +--------+-------+----+--------+----------------------------------+ 552 554 | 0x2000 | 0x04 | RW | T | CR |
+3
Documentation/virt/kvm/api.rst
··· 2439 2439 PPC KVM_REG_PPC_PSSCR 64 2440 2440 PPC KVM_REG_PPC_DEC_EXPIRY 64 2441 2441 PPC KVM_REG_PPC_PTCR 64 2442 + PPC KVM_REG_PPC_HASHKEYR 64 2443 + PPC KVM_REG_PPC_HASHPKEYR 64 2442 2444 PPC KVM_REG_PPC_DAWR1 64 2443 2445 PPC KVM_REG_PPC_DAWRX1 64 2446 + PPC KVM_REG_PPC_DEXCR 64 2444 2447 PPC KVM_REG_PPC_TM_GPR0 64 2445 2448 ... 2446 2449 PPC KVM_REG_PPC_TM_GPR31 64
-1
MAINTAINERS
··· 12924 12924 LINUX FOR POWERPC EMBEDDED PPC4XX 12925 12925 L: linuxppc-dev@lists.ozlabs.org 12926 12926 S: Orphan 12927 - F: arch/powerpc/platforms/40x/ 12928 12927 F: arch/powerpc/platforms/44x/ 12929 12928 12930 12929 LINUX FOR POWERPC EMBEDDED PPC85XX
+7 -10
arch/powerpc/Kconfig
··· 149 149 select ARCH_HAS_PTE_SPECIAL 150 150 select ARCH_HAS_SCALED_CPUTIME if VIRT_CPU_ACCOUNTING_NATIVE && PPC_BOOK3S_64 151 151 select ARCH_HAS_SET_MEMORY 152 - select ARCH_HAS_STRICT_KERNEL_RWX if (PPC_BOOK3S || PPC_8xx || 40x) && !HIBERNATION 152 + select ARCH_HAS_STRICT_KERNEL_RWX if (PPC_BOOK3S || PPC_8xx) && !HIBERNATION 153 153 select ARCH_HAS_STRICT_KERNEL_RWX if PPC_85xx && !HIBERNATION && !RANDOMIZE_BASE 154 154 select ARCH_HAS_STRICT_MODULE_RWX if ARCH_HAS_STRICT_KERNEL_RWX 155 155 select ARCH_HAS_SYSCALL_WRAPPER if !SPU_BASE && !COMPAT ··· 167 167 select ARCH_SPLIT_ARG64 if PPC32 168 168 select ARCH_STACKWALK 169 169 select ARCH_SUPPORTS_ATOMIC_RMW 170 - select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC_BOOK3S || PPC_8xx || 40x 170 + select ARCH_SUPPORTS_DEBUG_PAGEALLOC if PPC_BOOK3S || PPC_8xx 171 171 select ARCH_USE_BUILTIN_BSWAP 172 172 select ARCH_USE_CMPXCHG_LOCKREF if PPC64 173 173 select ARCH_USE_MEMTEST ··· 389 389 def_bool y 390 390 depends on ADB_PMU || PPC_EFIKA || PPC_LITE5200 || PPC_83xx || \ 391 391 (PPC_85xx && !PPC_E500MC) || PPC_86xx || PPC_PSERIES \ 392 - || 44x || 40x 392 + || 44x 393 393 394 394 config ARCH_SUSPEND_NONZERO_CPU 395 395 def_bool y ··· 443 443 444 444 config PPC_ADV_DEBUG_REGS 445 445 bool 446 - depends on 40x || BOOKE 446 + depends on BOOKE 447 447 default y 448 448 449 449 config PPC_ADV_DEBUG_IACS ··· 490 490 491 491 config MATH_EMULATION 492 492 bool "Math emulation" 493 - depends on 4xx || PPC_8xx || PPC_MPC832x || BOOKE || PPC_MICROWATT 493 + depends on 44x || PPC_8xx || PPC_MPC832x || BOOKE || PPC_MICROWATT 494 494 select PPC_FPU_REGS 495 495 help 496 496 Some PowerPC chips designed for embedded applications do not have ··· 1077 1077 config PPC_INDIRECT_PCI 1078 1078 bool 1079 1079 depends on PCI 1080 - default y if 40x || 44x 1080 + default y if 44x 1081 1081 1082 1082 config SBUS 1083 1083 bool ··· 1102 1102 config PPC4xx_CPM 1103 1103 bool 1104 1104 default y 1105 - depends on SUSPEND && (44x || 40x) 1105 + depends on SUSPEND && 44x 1106 1106 help 1107 1107 PPC4xx Clock Power Management (CPM) support (suspend/resume). 1108 1108 It also enables support for two different idle states (idle-wait 1109 1109 and idle-doze). 1110 - 1111 - config 4xx_SOC 1112 - bool 1113 1110 1114 1111 config FSL_LBC 1115 1112 bool "Freescale Local Bus support"
-13
arch/powerpc/Kconfig.debug
··· 244 244 inbuilt serial port. If you enable this, ensure you set 245 245 PPC_EARLY_DEBUG_44x_PHYSLOW below to suit your target board. 246 246 247 - config PPC_EARLY_DEBUG_40x 248 - bool "Early serial debugging for IBM/AMCC 40x CPUs" 249 - depends on 40x 250 - help 251 - Select this to enable early debugging for IBM 40x chips via the 252 - inbuilt serial port. This works on chips with a 16550 compatible 253 - UART. 254 - 255 247 config PPC_EARLY_DEBUG_CPM 256 248 bool "Early serial debugging for Freescale CPM-based serial ports" 257 249 depends on SERIAL_CPM=y ··· 347 355 hex "EPRN of early debug UART physical address" 348 356 depends on PPC_EARLY_DEBUG_44x 349 357 default "0x1" 350 - 351 - config PPC_EARLY_DEBUG_40x_PHYSADDR 352 - hex "Early debug UART physical address" 353 - depends on PPC_EARLY_DEBUG_40x 354 - default "0xef600300" 355 358 356 359 config PPC_EARLY_DEBUG_CPM_ADDR 357 360 hex "CPM UART early debug transmit descriptor address"
-5
arch/powerpc/Makefile
··· 301 301 $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/book3s_32.config \ 302 302 -f $(srctree)/Makefile allmodconfig 303 303 304 - generated_configs += ppc40x_allmodconfig 305 - ppc40x_allmodconfig: 306 - $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/40x.config \ 307 - -f $(srctree)/Makefile allmodconfig 308 - 309 304 generated_configs += ppc44x_allmodconfig 310 305 ppc44x_allmodconfig: 311 306 $(Q)$(MAKE) KCONFIG_ALLCONFIG=$(srctree)/arch/powerpc/configs/44x.config \
-266
arch/powerpc/boot/4xx.c
··· 253 253 dt_fixup_memory(0, memsize); 254 254 } 255 255 256 - #define SPRN_DBCR0_40X 0x3F2 257 256 #define SPRN_DBCR0_44X 0x134 258 257 #define DBCR0_RST_SYSTEM 0x30000000 259 258 ··· 267 268 : "=&r"(tmp) : "i"(SPRN_DBCR0_44X), "i"(DBCR0_RST_SYSTEM) 268 269 ); 269 270 270 - } 271 - 272 - void ibm40x_dbcr_reset(void) 273 - { 274 - unsigned long tmp; 275 - 276 - asm volatile ( 277 - "mfspr %0,%1\n" 278 - "oris %0,%0,%2@h\n" 279 - "mtspr %1,%0" 280 - : "=&r"(tmp) : "i"(SPRN_DBCR0_40X), "i"(DBCR0_RST_SYSTEM) 281 - ); 282 271 } 283 272 284 273 #define EMAC_RESET 0x20000000 ··· 530 543 eplike_fixup_uart_clk(0, "/plb/opb/serial@f0000200", ser_clk, plb_clk); 531 544 eplike_fixup_uart_clk(1, "/plb/opb/serial@f0000300", ser_clk, plb_clk); 532 545 eplike_fixup_uart_clk(2, "/plb/opb/serial@f0000600", ser_clk, plb_clk); 533 - } 534 - 535 - void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk) 536 - { 537 - u32 pllmr = mfdcr(DCRN_CPC0_PLLMR); 538 - u32 cpc0_cr0 = mfdcr(DCRN_405_CPC0_CR0); 539 - u32 cpc0_cr1 = mfdcr(DCRN_405_CPC0_CR1); 540 - u32 psr = mfdcr(DCRN_405_CPC0_PSR); 541 - u32 cpu, plb, opb, ebc, tb, uart0, uart1, m; 542 - u32 fwdv, fwdvb, fbdv, cbdv, opdv, epdv, ppdv, udiv; 543 - 544 - fwdv = (8 - ((pllmr & 0xe0000000) >> 29)); 545 - fbdv = (pllmr & 0x1e000000) >> 25; 546 - if (fbdv == 0) 547 - fbdv = 16; 548 - cbdv = ((pllmr & 0x00060000) >> 17) + 1; /* CPU:PLB */ 549 - opdv = ((pllmr & 0x00018000) >> 15) + 1; /* PLB:OPB */ 550 - ppdv = ((pllmr & 0x00006000) >> 13) + 1; /* PLB:PCI */ 551 - epdv = ((pllmr & 0x00001800) >> 11) + 2; /* PLB:EBC */ 552 - udiv = ((cpc0_cr0 & 0x3e) >> 1) + 1; 553 - 554 - /* check for 405GPr */ 555 - if ((mfpvr() & 0xfffffff0) == (0x50910951 & 0xfffffff0)) { 556 - fwdvb = 8 - (pllmr & 0x00000007); 557 - if (!(psr & 0x00001000)) /* PCI async mode enable == 0 */ 558 - if (psr & 0x00000020) /* New mode enable */ 559 - m = fwdvb * 2 * ppdv; 560 - else 561 - m = fwdvb * cbdv * ppdv; 562 - else if (psr & 0x00000020) /* New mode enable */ 563 - if (psr & 0x00000800) /* PerClk synch mode */ 564 - m = fwdvb * 2 * epdv; 565 - else 566 - m = fbdv * fwdv; 567 - else if (epdv == fbdv) 568 - m = fbdv * cbdv * epdv; 569 - else 570 - m = fbdv * fwdvb * cbdv; 571 - 572 - cpu = sys_clk * m / fwdv; 573 - plb = sys_clk * m / (fwdvb * cbdv); 574 - } else { 575 - m = fwdv * fbdv * cbdv; 576 - cpu = sys_clk * m / fwdv; 577 - plb = cpu / cbdv; 578 - } 579 - opb = plb / opdv; 580 - ebc = plb / epdv; 581 - 582 - if (cpc0_cr0 & 0x80) 583 - /* uart0 uses the external clock */ 584 - uart0 = ser_clk; 585 - else 586 - uart0 = cpu / udiv; 587 - 588 - if (cpc0_cr0 & 0x40) 589 - /* uart1 uses the external clock */ 590 - uart1 = ser_clk; 591 - else 592 - uart1 = cpu / udiv; 593 - 594 - /* setup the timebase clock to tick at the cpu frequency */ 595 - cpc0_cr1 = cpc0_cr1 & ~0x00800000; 596 - mtdcr(DCRN_405_CPC0_CR1, cpc0_cr1); 597 - tb = cpu; 598 - 599 - dt_fixup_cpu_clocks(cpu, tb, 0); 600 - dt_fixup_clock("/plb", plb); 601 - dt_fixup_clock("/plb/opb", opb); 602 - dt_fixup_clock("/plb/ebc", ebc); 603 - dt_fixup_clock("/plb/opb/serial@ef600300", uart0); 604 - dt_fixup_clock("/plb/opb/serial@ef600400", uart1); 605 - } 606 - 607 - 608 - void ibm405ep_fixup_clocks(unsigned int sys_clk) 609 - { 610 - u32 pllmr0 = mfdcr(DCRN_CPC0_PLLMR0); 611 - u32 pllmr1 = mfdcr(DCRN_CPC0_PLLMR1); 612 - u32 cpc0_ucr = mfdcr(DCRN_CPC0_UCR); 613 - u32 cpu, plb, opb, ebc, uart0, uart1; 614 - u32 fwdva, fwdvb, fbdv, cbdv, opdv, epdv; 615 - u32 pllmr0_ccdv, tb, m; 616 - 617 - fwdva = 8 - ((pllmr1 & 0x00070000) >> 16); 618 - fwdvb = 8 - ((pllmr1 & 0x00007000) >> 12); 619 - fbdv = (pllmr1 & 0x00f00000) >> 20; 620 - if (fbdv == 0) 621 - fbdv = 16; 622 - 623 - cbdv = ((pllmr0 & 0x00030000) >> 16) + 1; /* CPU:PLB */ 624 - epdv = ((pllmr0 & 0x00000300) >> 8) + 2; /* PLB:EBC */ 625 - opdv = ((pllmr0 & 0x00003000) >> 12) + 1; /* PLB:OPB */ 626 - 627 - m = fbdv * fwdvb; 628 - 629 - pllmr0_ccdv = ((pllmr0 & 0x00300000) >> 20) + 1; 630 - if (pllmr1 & 0x80000000) 631 - cpu = sys_clk * m / (fwdva * pllmr0_ccdv); 632 - else 633 - cpu = sys_clk / pllmr0_ccdv; 634 - 635 - plb = cpu / cbdv; 636 - opb = plb / opdv; 637 - ebc = plb / epdv; 638 - tb = cpu; 639 - uart0 = cpu / (cpc0_ucr & 0x0000007f); 640 - uart1 = cpu / ((cpc0_ucr & 0x00007f00) >> 8); 641 - 642 - dt_fixup_cpu_clocks(cpu, tb, 0); 643 - dt_fixup_clock("/plb", plb); 644 - dt_fixup_clock("/plb/opb", opb); 645 - dt_fixup_clock("/plb/ebc", ebc); 646 - dt_fixup_clock("/plb/opb/serial@ef600300", uart0); 647 - dt_fixup_clock("/plb/opb/serial@ef600400", uart1); 648 - } 649 - 650 - static u8 ibm405ex_fwdv_multi_bits[] = { 651 - /* values for: 1 - 16 */ 652 - 0x01, 0x02, 0x0e, 0x09, 0x04, 0x0b, 0x10, 0x0d, 0x0c, 0x05, 653 - 0x06, 0x0f, 0x0a, 0x07, 0x08, 0x03 654 - }; 655 - 656 - u32 ibm405ex_get_fwdva(unsigned long cpr_fwdv) 657 - { 658 - u32 index; 659 - 660 - for (index = 0; index < ARRAY_SIZE(ibm405ex_fwdv_multi_bits); index++) 661 - if (cpr_fwdv == (u32)ibm405ex_fwdv_multi_bits[index]) 662 - return index + 1; 663 - 664 - return 0; 665 - } 666 - 667 - static u8 ibm405ex_fbdv_multi_bits[] = { 668 - /* values for: 1 - 100 */ 669 - 0x00, 0xff, 0x7e, 0xfd, 0x7a, 0xf5, 0x6a, 0xd5, 0x2a, 0xd4, 670 - 0x29, 0xd3, 0x26, 0xcc, 0x19, 0xb3, 0x67, 0xce, 0x1d, 0xbb, 671 - 0x77, 0xee, 0x5d, 0xba, 0x74, 0xe9, 0x52, 0xa5, 0x4b, 0x96, 672 - 0x2c, 0xd8, 0x31, 0xe3, 0x46, 0x8d, 0x1b, 0xb7, 0x6f, 0xde, 673 - 0x3d, 0xfb, 0x76, 0xed, 0x5a, 0xb5, 0x6b, 0xd6, 0x2d, 0xdb, 674 - 0x36, 0xec, 0x59, 0xb2, 0x64, 0xc9, 0x12, 0xa4, 0x48, 0x91, 675 - 0x23, 0xc7, 0x0e, 0x9c, 0x38, 0xf0, 0x61, 0xc2, 0x05, 0x8b, 676 - 0x17, 0xaf, 0x5f, 0xbe, 0x7c, 0xf9, 0x72, 0xe5, 0x4a, 0x95, 677 - 0x2b, 0xd7, 0x2e, 0xdc, 0x39, 0xf3, 0x66, 0xcd, 0x1a, 0xb4, 678 - 0x68, 0xd1, 0x22, 0xc4, 0x09, 0x93, 0x27, 0xcf, 0x1e, 0xbc, 679 - /* values for: 101 - 200 */ 680 - 0x78, 0xf1, 0x62, 0xc5, 0x0a, 0x94, 0x28, 0xd0, 0x21, 0xc3, 681 - 0x06, 0x8c, 0x18, 0xb0, 0x60, 0xc1, 0x02, 0x84, 0x08, 0x90, 682 - 0x20, 0xc0, 0x01, 0x83, 0x07, 0x8f, 0x1f, 0xbf, 0x7f, 0xfe, 683 - 0x7d, 0xfa, 0x75, 0xea, 0x55, 0xaa, 0x54, 0xa9, 0x53, 0xa6, 684 - 0x4c, 0x99, 0x33, 0xe7, 0x4e, 0x9d, 0x3b, 0xf7, 0x6e, 0xdd, 685 - 0x3a, 0xf4, 0x69, 0xd2, 0x25, 0xcb, 0x16, 0xac, 0x58, 0xb1, 686 - 0x63, 0xc6, 0x0d, 0x9b, 0x37, 0xef, 0x5e, 0xbd, 0x7b, 0xf6, 687 - 0x6d, 0xda, 0x35, 0xeb, 0x56, 0xad, 0x5b, 0xb6, 0x6c, 0xd9, 688 - 0x32, 0xe4, 0x49, 0x92, 0x24, 0xc8, 0x11, 0xa3, 0x47, 0x8e, 689 - 0x1c, 0xb8, 0x70, 0xe1, 0x42, 0x85, 0x0b, 0x97, 0x2f, 0xdf, 690 - /* values for: 201 - 255 */ 691 - 0x3e, 0xfc, 0x79, 0xf2, 0x65, 0xca, 0x15, 0xab, 0x57, 0xae, 692 - 0x5c, 0xb9, 0x73, 0xe6, 0x4d, 0x9a, 0x34, 0xe8, 0x51, 0xa2, 693 - 0x44, 0x89, 0x13, 0xa7, 0x4f, 0x9e, 0x3c, 0xf8, 0x71, 0xe2, 694 - 0x45, 0x8a, 0x14, 0xa8, 0x50, 0xa1, 0x43, 0x86, 0x0c, 0x98, 695 - 0x30, 0xe0, 0x41, 0x82, 0x04, 0x88, 0x10, 0xa0, 0x40, 0x81, 696 - 0x03, 0x87, 0x0f, 0x9f, 0x3f /* END */ 697 - }; 698 - 699 - u32 ibm405ex_get_fbdv(unsigned long cpr_fbdv) 700 - { 701 - u32 index; 702 - 703 - for (index = 0; index < ARRAY_SIZE(ibm405ex_fbdv_multi_bits); index++) 704 - if (cpr_fbdv == (u32)ibm405ex_fbdv_multi_bits[index]) 705 - return index + 1; 706 - 707 - return 0; 708 - } 709 - 710 - void ibm405ex_fixup_clocks(unsigned int sys_clk, unsigned int uart_clk) 711 - { 712 - /* PLL config */ 713 - u32 pllc = CPR0_READ(DCRN_CPR0_PLLC); 714 - u32 plld = CPR0_READ(DCRN_CPR0_PLLD); 715 - u32 cpud = CPR0_READ(DCRN_CPR0_PRIMAD); 716 - u32 plbd = CPR0_READ(DCRN_CPR0_PRIMBD); 717 - u32 opbd = CPR0_READ(DCRN_CPR0_OPBD); 718 - u32 perd = CPR0_READ(DCRN_CPR0_PERD); 719 - 720 - /* Dividers */ 721 - u32 fbdv = ibm405ex_get_fbdv(__fix_zero((plld >> 24) & 0xff, 1)); 722 - 723 - u32 fwdva = ibm405ex_get_fwdva(__fix_zero((plld >> 16) & 0x0f, 1)); 724 - 725 - u32 cpudv0 = __fix_zero((cpud >> 24) & 7, 8); 726 - 727 - /* PLBDV0 is hardwared to 010. */ 728 - u32 plbdv0 = 2; 729 - u32 plb2xdv0 = __fix_zero((plbd >> 16) & 7, 8); 730 - 731 - u32 opbdv0 = __fix_zero((opbd >> 24) & 3, 4); 732 - 733 - u32 perdv0 = __fix_zero((perd >> 24) & 3, 4); 734 - 735 - /* Resulting clocks */ 736 - u32 cpu, plb, opb, ebc, vco, tb, uart0, uart1; 737 - 738 - /* PLL's VCO is the source for primary forward ? */ 739 - if (pllc & 0x40000000) { 740 - u32 m; 741 - 742 - /* Feedback path */ 743 - switch ((pllc >> 24) & 7) { 744 - case 0: 745 - /* PLLOUTx */ 746 - m = fbdv; 747 - break; 748 - case 1: 749 - /* CPU */ 750 - m = fbdv * fwdva * cpudv0; 751 - break; 752 - case 5: 753 - /* PERClk */ 754 - m = fbdv * fwdva * plb2xdv0 * plbdv0 * opbdv0 * perdv0; 755 - break; 756 - default: 757 - printf("WARNING ! Invalid PLL feedback source !\n"); 758 - goto bypass; 759 - } 760 - 761 - vco = (unsigned int)(sys_clk * m); 762 - } else { 763 - bypass: 764 - /* Bypass system PLL */ 765 - vco = 0; 766 - } 767 - 768 - /* CPU = VCO / ( FWDVA x CPUDV0) */ 769 - cpu = vco / (fwdva * cpudv0); 770 - /* PLB = VCO / ( FWDVA x PLB2XDV0 x PLBDV0) */ 771 - plb = vco / (fwdva * plb2xdv0 * plbdv0); 772 - /* OPB = PLB / OPBDV0 */ 773 - opb = plb / opbdv0; 774 - /* EBC = OPB / PERDV0 */ 775 - ebc = opb / perdv0; 776 - 777 - tb = cpu; 778 - uart0 = uart1 = uart_clk; 779 - 780 - dt_fixup_cpu_clocks(cpu, tb, 0); 781 - dt_fixup_clock("/plb", plb); 782 - dt_fixup_clock("/plb/opb", opb); 783 - dt_fixup_clock("/plb/opb/ebc", ebc); 784 - dt_fixup_clock("/plb/opb/serial@ef600200", uart0); 785 - dt_fixup_clock("/plb/opb/serial@ef600300", uart1); 786 546 }
-4
arch/powerpc/boot/4xx.h
··· 12 12 void ibm440spe_fixup_memsize(void); 13 13 void ibm4xx_denali_fixup_memsize(void); 14 14 void ibm44x_dbcr_reset(void); 15 - void ibm40x_dbcr_reset(void); 16 15 void ibm4xx_quiesce_eth(u32 *emac0, u32 *emac1); 17 16 void ibm4xx_fixup_ebc_ranges(const char *ebc); 18 17 19 - void ibm405gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk); 20 - void ibm405ep_fixup_clocks(unsigned int sys_clk); 21 - void ibm405ex_fixup_clocks(unsigned int sys_clk, unsigned int uart_clk); 22 18 void ibm440gp_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk); 23 19 void ibm440ep_fixup_clocks(unsigned int sys_clk, unsigned int ser_clk, 24 20 unsigned int tmr_clk);
-11
arch/powerpc/boot/Makefile
··· 54 54 55 55 $(obj)/4xx.o: BOOTTARGETFLAGS += -mcpu=405 56 56 $(obj)/ebony.o: BOOTTARGETFLAGS += -mcpu=440 57 - $(obj)/cuboot-hotfoot.o: BOOTTARGETFLAGS += -mcpu=405 58 57 $(obj)/cuboot-taishan.o: BOOTTARGETFLAGS += -mcpu=440 59 58 $(obj)/cuboot-katmai.o: BOOTTARGETFLAGS += -mcpu=440 60 - $(obj)/cuboot-acadia.o: BOOTTARGETFLAGS += -mcpu=405 61 59 $(obj)/treeboot-iss4xx.o: BOOTTARGETFLAGS += -mcpu=405 62 60 $(obj)/treeboot-currituck.o: BOOTTARGETFLAGS += -mcpu=405 63 61 $(obj)/treeboot-akebono.o: BOOTTARGETFLAGS += -mcpu=405 ··· 144 146 ifndef CONFIG_PPC64_BOOT_WRAPPER 145 147 src-wlib-y += crtsavres.S 146 148 endif 147 - src-wlib-$(CONFIG_40x) += 4xx.c planetcore.c 148 149 src-wlib-$(CONFIG_44x) += 4xx.c ebony.c bamboo.c 149 150 src-wlib-$(CONFIG_PPC_8xx) += mpc8xx.c planetcore.c fsl-soc.c 150 151 src-wlib-$(CONFIG_PPC_82xx) += pq2.c fsl-soc.c planetcore.c ··· 151 154 src-wlib-$(CONFIG_CPM) += cpm-serial.c 152 155 153 156 src-plat-y := of.c epapr.c 154 - src-plat-$(CONFIG_40x) += fixed-head.S cuboot-hotfoot.c \ 155 - cuboot-acadia.c \ 156 - cuboot-kilauea.c simpleboot.c 157 157 src-plat-$(CONFIG_44x) += treeboot-ebony.c cuboot-ebony.c treeboot-bamboo.c \ 158 158 cuboot-bamboo.c cuboot-sam440ep.c \ 159 159 cuboot-sequoia.c cuboot-rainier.c \ ··· 293 299 # They are only required on boards which do not have FDT support in firmware. 294 300 # Boards with newish u-boot firmware can use the uImage target above 295 301 # 296 - 297 - # Board ports in arch/powerpc/platform/40x/Kconfig 298 - image-$(CONFIG_HOTFOOT) += cuImage.hotfoot 299 - image-$(CONFIG_ACADIA) += cuImage.acadia 300 - image-$(CONFIG_OBS600) += uImage.obs600 301 302 302 303 # Board ports in arch/powerpc/platform/44x/Kconfig 303 304 image-$(CONFIG_EBONY) += treeImage.ebony cuImage.ebony
-171
arch/powerpc/boot/cuboot-acadia.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * Old U-boot compatibility for Acadia 4 - * 5 - * Author: Josh Boyer <jwboyer@linux.vnet.ibm.com> 6 - * 7 - * Copyright 2008 IBM Corporation 8 - */ 9 - 10 - #include "ops.h" 11 - #include "io.h" 12 - #include "dcr.h" 13 - #include "stdio.h" 14 - #include "4xx.h" 15 - #include "44x.h" 16 - #include "cuboot.h" 17 - 18 - #define TARGET_4xx 19 - #include "ppcboot.h" 20 - 21 - static bd_t bd; 22 - 23 - #define CPR_PERD0_SPIDV_MASK 0x000F0000 /* SPI Clock Divider */ 24 - 25 - #define PLLC_SRC_MASK 0x20000000 /* PLL feedback source */ 26 - 27 - #define PLLD_FBDV_MASK 0x1F000000 /* PLL feedback divider value */ 28 - #define PLLD_FWDVA_MASK 0x000F0000 /* PLL forward divider A value */ 29 - #define PLLD_FWDVB_MASK 0x00000700 /* PLL forward divider B value */ 30 - 31 - #define PRIMAD_CPUDV_MASK 0x0F000000 /* CPU Clock Divisor Mask */ 32 - #define PRIMAD_PLBDV_MASK 0x000F0000 /* PLB Clock Divisor Mask */ 33 - #define PRIMAD_OPBDV_MASK 0x00000F00 /* OPB Clock Divisor Mask */ 34 - #define PRIMAD_EBCDV_MASK 0x0000000F /* EBC Clock Divisor Mask */ 35 - 36 - #define PERD0_PWMDV_MASK 0xFF000000 /* PWM Divider Mask */ 37 - #define PERD0_SPIDV_MASK 0x000F0000 /* SPI Divider Mask */ 38 - #define PERD0_U0DV_MASK 0x0000FF00 /* UART 0 Divider Mask */ 39 - #define PERD0_U1DV_MASK 0x000000FF /* UART 1 Divider Mask */ 40 - 41 - static void get_clocks(void) 42 - { 43 - unsigned long sysclk, cpr_plld, cpr_pllc, cpr_primad, plloutb, i; 44 - unsigned long pllFwdDiv, pllFwdDivB, pllFbkDiv, pllPlbDiv, pllExtBusDiv; 45 - unsigned long pllOpbDiv, freqEBC, freqUART, freqOPB; 46 - unsigned long div; /* total divisor udiv * bdiv */ 47 - unsigned long umin; /* minimum udiv */ 48 - unsigned short diff; /* smallest diff */ 49 - unsigned long udiv; /* best udiv */ 50 - unsigned short idiff; /* current diff */ 51 - unsigned short ibdiv; /* current bdiv */ 52 - unsigned long est; /* current estimate */ 53 - unsigned long baud; 54 - void *np; 55 - 56 - /* read the sysclk value from the CPLD */ 57 - sysclk = (in_8((unsigned char *)0x80000000) == 0xc) ? 66666666 : 33333000; 58 - 59 - /* 60 - * Read PLL Mode registers 61 - */ 62 - cpr_plld = CPR0_READ(DCRN_CPR0_PLLD); 63 - cpr_pllc = CPR0_READ(DCRN_CPR0_PLLC); 64 - 65 - /* 66 - * Determine forward divider A 67 - */ 68 - pllFwdDiv = ((cpr_plld & PLLD_FWDVA_MASK) >> 16); 69 - 70 - /* 71 - * Determine forward divider B 72 - */ 73 - pllFwdDivB = ((cpr_plld & PLLD_FWDVB_MASK) >> 8); 74 - if (pllFwdDivB == 0) 75 - pllFwdDivB = 8; 76 - 77 - /* 78 - * Determine FBK_DIV. 79 - */ 80 - pllFbkDiv = ((cpr_plld & PLLD_FBDV_MASK) >> 24); 81 - if (pllFbkDiv == 0) 82 - pllFbkDiv = 256; 83 - 84 - /* 85 - * Read CPR_PRIMAD register 86 - */ 87 - cpr_primad = CPR0_READ(DCRN_CPR0_PRIMAD); 88 - 89 - /* 90 - * Determine PLB_DIV. 91 - */ 92 - pllPlbDiv = ((cpr_primad & PRIMAD_PLBDV_MASK) >> 16); 93 - if (pllPlbDiv == 0) 94 - pllPlbDiv = 16; 95 - 96 - /* 97 - * Determine EXTBUS_DIV. 98 - */ 99 - pllExtBusDiv = (cpr_primad & PRIMAD_EBCDV_MASK); 100 - if (pllExtBusDiv == 0) 101 - pllExtBusDiv = 16; 102 - 103 - /* 104 - * Determine OPB_DIV. 105 - */ 106 - pllOpbDiv = ((cpr_primad & PRIMAD_OPBDV_MASK) >> 8); 107 - if (pllOpbDiv == 0) 108 - pllOpbDiv = 16; 109 - 110 - /* There is a bug in U-Boot that prevents us from using 111 - * bd.bi_opbfreq because U-Boot doesn't populate it for 112 - * 405EZ. We get to calculate it, yay! 113 - */ 114 - freqOPB = (sysclk *pllFbkDiv) /pllOpbDiv; 115 - 116 - freqEBC = (sysclk * pllFbkDiv) / pllExtBusDiv; 117 - 118 - plloutb = ((sysclk * ((cpr_pllc & PLLC_SRC_MASK) ? 119 - pllFwdDivB : pllFwdDiv) * 120 - pllFbkDiv) / pllFwdDivB); 121 - 122 - np = find_node_by_alias("serial0"); 123 - if (getprop(np, "current-speed", &baud, sizeof(baud)) != sizeof(baud)) 124 - fatal("no current-speed property\n\r"); 125 - 126 - udiv = 256; /* Assume lowest possible serial clk */ 127 - div = plloutb / (16 * baud); /* total divisor */ 128 - umin = (plloutb / freqOPB) << 1; /* 2 x OPB divisor */ 129 - diff = 256; /* highest possible */ 130 - 131 - /* i is the test udiv value -- start with the largest 132 - * possible (256) to minimize serial clock and constrain 133 - * search to umin. 134 - */ 135 - for (i = 256; i > umin; i--) { 136 - ibdiv = div / i; 137 - est = i * ibdiv; 138 - idiff = (est > div) ? (est-div) : (div-est); 139 - if (idiff == 0) { 140 - udiv = i; 141 - break; /* can't do better */ 142 - } else if (idiff < diff) { 143 - udiv = i; /* best so far */ 144 - diff = idiff; /* update lowest diff*/ 145 - } 146 - } 147 - freqUART = plloutb / udiv; 148 - 149 - dt_fixup_cpu_clocks(bd.bi_procfreq, bd.bi_intfreq, bd.bi_plb_busfreq); 150 - dt_fixup_clock("/plb/ebc", freqEBC); 151 - dt_fixup_clock("/plb/opb", freqOPB); 152 - dt_fixup_clock("/plb/opb/serial@ef600300", freqUART); 153 - dt_fixup_clock("/plb/opb/serial@ef600400", freqUART); 154 - } 155 - 156 - static void acadia_fixups(void) 157 - { 158 - dt_fixup_memory(bd.bi_memstart, bd.bi_memsize); 159 - get_clocks(); 160 - dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr); 161 - } 162 - 163 - void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, 164 - unsigned long r6, unsigned long r7) 165 - { 166 - CUBOOT_INIT(); 167 - platform_ops.fixups = acadia_fixups; 168 - platform_ops.exit = ibm40x_dbcr_reset; 169 - fdt_init(_dtb_start); 170 - serial_console_init(); 171 - }
-139
arch/powerpc/boot/cuboot-hotfoot.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * Old U-boot compatibility for Esteem 195E Hotfoot CPU Board 4 - * 5 - * Author: Solomon Peachy <solomon@linux-wlan.com> 6 - */ 7 - 8 - #include "ops.h" 9 - #include "stdio.h" 10 - #include "reg.h" 11 - #include "dcr.h" 12 - #include "4xx.h" 13 - #include "cuboot.h" 14 - 15 - #define TARGET_4xx 16 - #define TARGET_HOTFOOT 17 - 18 - #include "ppcboot-hotfoot.h" 19 - 20 - static bd_t bd; 21 - 22 - #define NUM_REGS 3 23 - 24 - static void hotfoot_fixups(void) 25 - { 26 - u32 uart = mfdcr(DCRN_CPC0_UCR) & 0x7f; 27 - 28 - dt_fixup_memory(bd.bi_memstart, bd.bi_memsize); 29 - 30 - dt_fixup_cpu_clocks(bd.bi_procfreq, bd.bi_procfreq, 0); 31 - dt_fixup_clock("/plb", bd.bi_plb_busfreq); 32 - dt_fixup_clock("/plb/opb", bd.bi_opbfreq); 33 - dt_fixup_clock("/plb/ebc", bd.bi_pci_busfreq); 34 - dt_fixup_clock("/plb/opb/serial@ef600300", bd.bi_procfreq / uart); 35 - dt_fixup_clock("/plb/opb/serial@ef600400", bd.bi_procfreq / uart); 36 - 37 - dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr); 38 - dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr); 39 - 40 - /* Is this a single eth/serial board? */ 41 - if ((bd.bi_enet1addr[0] == 0) && 42 - (bd.bi_enet1addr[1] == 0) && 43 - (bd.bi_enet1addr[2] == 0) && 44 - (bd.bi_enet1addr[3] == 0) && 45 - (bd.bi_enet1addr[4] == 0) && 46 - (bd.bi_enet1addr[5] == 0)) { 47 - void *devp; 48 - 49 - printf("Trimming devtree for single serial/eth board\n"); 50 - 51 - devp = finddevice("/plb/opb/serial@ef600300"); 52 - if (!devp) 53 - fatal("Can't find node for /plb/opb/serial@ef600300"); 54 - del_node(devp); 55 - 56 - devp = finddevice("/plb/opb/ethernet@ef600900"); 57 - if (!devp) 58 - fatal("Can't find node for /plb/opb/ethernet@ef600900"); 59 - del_node(devp); 60 - } 61 - 62 - ibm4xx_quiesce_eth((u32 *)0xef600800, (u32 *)0xef600900); 63 - 64 - /* Fix up flash size in fdt for 4M boards. */ 65 - if (bd.bi_flashsize < 0x800000) { 66 - u32 regs[NUM_REGS]; 67 - void *devp = finddevice("/plb/ebc/nor_flash@0"); 68 - if (!devp) 69 - fatal("Can't find FDT node for nor_flash!??"); 70 - 71 - printf("Fixing devtree for 4M Flash\n"); 72 - 73 - /* First fix up the base address */ 74 - getprop(devp, "reg", regs, sizeof(regs)); 75 - regs[0] = 0; 76 - regs[1] = 0xffc00000; 77 - regs[2] = 0x00400000; 78 - setprop(devp, "reg", regs, sizeof(regs)); 79 - 80 - /* Then the offsets */ 81 - devp = finddevice("/plb/ebc/nor_flash@0/partition@0"); 82 - if (!devp) 83 - fatal("Can't find FDT node for partition@0"); 84 - getprop(devp, "reg", regs, 2*sizeof(u32)); 85 - regs[0] -= 0x400000; 86 - setprop(devp, "reg", regs, 2*sizeof(u32)); 87 - 88 - devp = finddevice("/plb/ebc/nor_flash@0/partition@1"); 89 - if (!devp) 90 - fatal("Can't find FDT node for partition@1"); 91 - getprop(devp, "reg", regs, 2*sizeof(u32)); 92 - regs[0] -= 0x400000; 93 - setprop(devp, "reg", regs, 2*sizeof(u32)); 94 - 95 - devp = finddevice("/plb/ebc/nor_flash@0/partition@2"); 96 - if (!devp) 97 - fatal("Can't find FDT node for partition@2"); 98 - getprop(devp, "reg", regs, 2*sizeof(u32)); 99 - regs[0] -= 0x400000; 100 - setprop(devp, "reg", regs, 2*sizeof(u32)); 101 - 102 - devp = finddevice("/plb/ebc/nor_flash@0/partition@3"); 103 - if (!devp) 104 - fatal("Can't find FDT node for partition@3"); 105 - getprop(devp, "reg", regs, 2*sizeof(u32)); 106 - regs[0] -= 0x400000; 107 - setprop(devp, "reg", regs, 2*sizeof(u32)); 108 - 109 - devp = finddevice("/plb/ebc/nor_flash@0/partition@4"); 110 - if (!devp) 111 - fatal("Can't find FDT node for partition@4"); 112 - getprop(devp, "reg", regs, 2*sizeof(u32)); 113 - regs[0] -= 0x400000; 114 - setprop(devp, "reg", regs, 2*sizeof(u32)); 115 - 116 - devp = finddevice("/plb/ebc/nor_flash@0/partition@6"); 117 - if (!devp) 118 - fatal("Can't find FDT node for partition@6"); 119 - getprop(devp, "reg", regs, 2*sizeof(u32)); 120 - regs[0] -= 0x400000; 121 - setprop(devp, "reg", regs, 2*sizeof(u32)); 122 - 123 - /* Delete the FeatFS node */ 124 - devp = finddevice("/plb/ebc/nor_flash@0/partition@5"); 125 - if (!devp) 126 - fatal("Can't find FDT node for partition@5"); 127 - del_node(devp); 128 - } 129 - } 130 - 131 - void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, 132 - unsigned long r6, unsigned long r7) 133 - { 134 - CUBOOT_INIT(); 135 - platform_ops.fixups = hotfoot_fixups; 136 - platform_ops.exit = ibm40x_dbcr_reset; 137 - fdt_init(_dtb_start); 138 - serial_console_init(); 139 - }
-46
arch/powerpc/boot/cuboot-kilauea.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * Old U-boot compatibility for PPC405EX. This image is already included 4 - * a dtb. 5 - * 6 - * Author: Tiejun Chen <tiejun.chen@windriver.com> 7 - * 8 - * Copyright (C) 2009 Wind River Systems, Inc. 9 - */ 10 - 11 - #include "ops.h" 12 - #include "io.h" 13 - #include "dcr.h" 14 - #include "stdio.h" 15 - #include "4xx.h" 16 - #include "44x.h" 17 - #include "cuboot.h" 18 - 19 - #define TARGET_4xx 20 - #define TARGET_44x 21 - #include "ppcboot.h" 22 - 23 - #define KILAUEA_SYS_EXT_SERIAL_CLOCK 11059200 /* ext. 11.059MHz clk */ 24 - 25 - static bd_t bd; 26 - 27 - static void kilauea_fixups(void) 28 - { 29 - unsigned long sysclk = 33333333; 30 - 31 - ibm405ex_fixup_clocks(sysclk, KILAUEA_SYS_EXT_SERIAL_CLOCK); 32 - dt_fixup_memory(bd.bi_memstart, bd.bi_memsize); 33 - ibm4xx_fixup_ebc_ranges("/plb/opb/ebc"); 34 - dt_fixup_mac_address_by_alias("ethernet0", bd.bi_enetaddr); 35 - dt_fixup_mac_address_by_alias("ethernet1", bd.bi_enet1addr); 36 - } 37 - 38 - void platform_init(unsigned long r3, unsigned long r4, unsigned long r5, 39 - unsigned long r6, unsigned long r7) 40 - { 41 - CUBOOT_INIT(); 42 - platform_ops.fixups = kilauea_fixups; 43 - platform_ops.exit = ibm40x_dbcr_reset; 44 - fdt_init(_dtb_start); 45 - serial_console_init(); 46 - }
-11
arch/powerpc/boot/dcr.h
··· 153 153 #define CPR0_SCPID 0x120 154 154 #define CPR0_PLLC0 0x40 155 155 156 - /* 405GP Clocking/Power Management/Chip Control regs */ 157 - #define DCRN_CPC0_PLLMR 0xb0 158 - #define DCRN_405_CPC0_CR0 0xb1 159 - #define DCRN_405_CPC0_CR1 0xb2 160 - #define DCRN_405_CPC0_PSR 0xb4 161 - 162 - /* 405EP Clocking/Power Management/Chip Control regs */ 163 - #define DCRN_CPC0_PLLMR0 0xf0 164 - #define DCRN_CPC0_PLLMR1 0xf4 165 - #define DCRN_CPC0_UCR 0xf5 166 - 167 156 /* 440GX/405EX Clock Control reg */ 168 157 #define DCRN_CPR0_CLKUPD 0x020 169 158 #define DCRN_CPR0_PLLC 0x040
-224
arch/powerpc/boot/dts/acadia.dts
··· 1 - /* 2 - * Device Tree Source for AMCC Acadia (405EZ) 3 - * 4 - * Copyright IBM Corp. 2008 5 - * 6 - * This file is licensed under the terms of the GNU General Public License 7 - * version 2. This program is licensed "as is" without any warranty of any 8 - * kind, whether express or implied. 9 - */ 10 - 11 - /dts-v1/; 12 - 13 - / { 14 - #address-cells = <1>; 15 - #size-cells = <1>; 16 - model = "amcc,acadia"; 17 - compatible = "amcc,acadia"; 18 - dcr-parent = <&{/cpus/cpu@0}>; 19 - 20 - aliases { 21 - ethernet0 = &EMAC0; 22 - serial0 = &UART0; 23 - serial1 = &UART1; 24 - }; 25 - 26 - cpus { 27 - #address-cells = <1>; 28 - #size-cells = <0>; 29 - 30 - cpu@0 { 31 - device_type = "cpu"; 32 - model = "PowerPC,405EZ"; 33 - reg = <0x0>; 34 - clock-frequency = <0>; /* Filled in by wrapper */ 35 - timebase-frequency = <0>; /* Filled in by wrapper */ 36 - i-cache-line-size = <32>; 37 - d-cache-line-size = <32>; 38 - i-cache-size = <16384>; 39 - d-cache-size = <16384>; 40 - dcr-controller; 41 - dcr-access-method = "native"; 42 - }; 43 - }; 44 - 45 - memory { 46 - device_type = "memory"; 47 - reg = <0x0 0x0>; /* Filled in by wrapper */ 48 - }; 49 - 50 - UIC0: interrupt-controller { 51 - compatible = "ibm,uic-405ez", "ibm,uic"; 52 - interrupt-controller; 53 - dcr-reg = <0x0c0 0x009>; 54 - cell-index = <0>; 55 - #address-cells = <0>; 56 - #size-cells = <0>; 57 - #interrupt-cells = <2>; 58 - }; 59 - 60 - plb { 61 - compatible = "ibm,plb-405ez", "ibm,plb3"; 62 - #address-cells = <1>; 63 - #size-cells = <1>; 64 - ranges; 65 - clock-frequency = <0>; /* Filled in by wrapper */ 66 - 67 - MAL0: mcmal { 68 - compatible = "ibm,mcmal-405ez", "ibm,mcmal"; 69 - dcr-reg = <0x380 0x62>; 70 - num-tx-chans = <1>; 71 - num-rx-chans = <1>; 72 - interrupt-parent = <&UIC0>; 73 - /* 405EZ has only 3 interrupts to the UIC, as 74 - * SERR, TXDE, and RXDE are or'd together into 75 - * one UIC bit 76 - */ 77 - interrupts = < 78 - 0x13 0x4 /* TXEOB */ 79 - 0x15 0x4 /* RXEOB */ 80 - 0x12 0x4 /* SERR, TXDE, RXDE */>; 81 - }; 82 - 83 - POB0: opb { 84 - compatible = "ibm,opb-405ez", "ibm,opb"; 85 - #address-cells = <1>; 86 - #size-cells = <1>; 87 - ranges; 88 - dcr-reg = <0x0a 0x05>; 89 - clock-frequency = <0>; /* Filled in by wrapper */ 90 - 91 - UART0: serial@ef600300 { 92 - device_type = "serial"; 93 - compatible = "ns16550"; 94 - reg = <0xef600300 0x8>; 95 - virtual-reg = <0xef600300>; 96 - clock-frequency = <0>; /* Filled in by wrapper */ 97 - current-speed = <115200>; 98 - interrupt-parent = <&UIC0>; 99 - interrupts = <0x5 0x4>; 100 - }; 101 - 102 - UART1: serial@ef600400 { 103 - device_type = "serial"; 104 - compatible = "ns16550"; 105 - reg = <0xef600400 0x8>; 106 - clock-frequency = <0>; /* Filled in by wrapper */ 107 - current-speed = <115200>; 108 - interrupt-parent = <&UIC0>; 109 - interrupts = <0x6 0x4>; 110 - }; 111 - 112 - IIC: i2c@ef600500 { 113 - compatible = "ibm,iic-405ez", "ibm,iic"; 114 - reg = <0xef600500 0x11>; 115 - interrupt-parent = <&UIC0>; 116 - interrupts = <0xa 0x4>; 117 - }; 118 - 119 - GPIO0: gpio@ef600700 { 120 - compatible = "ibm,gpio-405ez"; 121 - reg = <0xef600700 0x20>; 122 - }; 123 - 124 - GPIO1: gpio@ef600800 { 125 - compatible = "ibm,gpio-405ez"; 126 - reg = <0xef600800 0x20>; 127 - }; 128 - 129 - EMAC0: ethernet@ef600900 { 130 - device_type = "network"; 131 - compatible = "ibm,emac-405ez", "ibm,emac"; 132 - interrupt-parent = <&UIC0>; 133 - interrupts = < 134 - 0x10 0x4 /* Ethernet */ 135 - 0x11 0x4 /* Ethernet Wake up */>; 136 - local-mac-address = [000000000000]; /* Filled in by wrapper */ 137 - reg = <0xef600900 0x70>; 138 - mal-device = <&MAL0>; 139 - mal-tx-channel = <0>; 140 - mal-rx-channel = <0>; 141 - cell-index = <0>; 142 - max-frame-size = <1500>; 143 - rx-fifo-size = <4096>; 144 - tx-fifo-size = <2048>; 145 - phy-mode = "mii"; 146 - phy-map = <0x0>; 147 - }; 148 - 149 - CAN0: can@ef601000 { 150 - compatible = "amcc,can-405ez"; 151 - reg = <0xef601000 0x620>; 152 - interrupt-parent = <&UIC0>; 153 - interrupts = <0x7 0x4>; 154 - }; 155 - 156 - CAN1: can@ef601800 { 157 - compatible = "amcc,can-405ez"; 158 - reg = <0xef601800 0x620>; 159 - interrupt-parent = <&UIC0>; 160 - interrupts = <0x8 0x4>; 161 - }; 162 - 163 - cameleon@ef602000 { 164 - compatible = "amcc,cameleon-405ez"; 165 - reg = <0xef602000 0x800>; 166 - interrupt-parent = <&UIC0>; 167 - interrupts = <0xb 0x4 0xc 0x4>; 168 - }; 169 - 170 - ieee1588@ef602800 { 171 - compatible = "amcc,ieee1588-405ez"; 172 - reg = <0xef602800 0x60>; 173 - interrupt-parent = <&UIC0>; 174 - interrupts = <0x4 0x4>; 175 - /* This thing is a bit weird. It has its own UIC 176 - * that it uses to generate snapshot triggers. We 177 - * don't really support this device yet, and it needs 178 - * work to figure this out. 179 - */ 180 - dcr-reg = <0xe0 0x9>; 181 - }; 182 - 183 - usb@ef603000 { 184 - compatible = "ohci-be"; 185 - reg = <0xef603000 0x80>; 186 - interrupt-parent = <&UIC0>; 187 - interrupts = <0xd 0x4 0xe 0x4>; 188 - }; 189 - 190 - dac@ef603300 { 191 - compatible = "amcc,dac-405ez"; 192 - reg = <0xef603300 0x40>; 193 - interrupt-parent = <&UIC0>; 194 - interrupts = <0x18 0x4>; 195 - }; 196 - 197 - adc@ef603400 { 198 - compatible = "amcc,adc-405ez"; 199 - reg = <0xef603400 0x40>; 200 - interrupt-parent = <&UIC0>; 201 - interrupts = <0x17 0x4>; 202 - }; 203 - 204 - spi@ef603500 { 205 - compatible = "amcc,spi-405ez"; 206 - reg = <0xef603500 0x100>; 207 - interrupt-parent = <&UIC0>; 208 - interrupts = <0x9 0x4>; 209 - }; 210 - }; 211 - 212 - EBC0: ebc { 213 - compatible = "ibm,ebc-405ez", "ibm,ebc"; 214 - dcr-reg = <0x12 0x2>; 215 - #address-cells = <2>; 216 - #size-cells = <1>; 217 - clock-frequency = <0>; /* Filled in by wrapper */ 218 - }; 219 - }; 220 - 221 - chosen { 222 - stdout-path = "/plb/opb/serial@ef600300"; 223 - }; 224 - };
-281
arch/powerpc/boot/dts/haleakala.dts
··· 1 - /* 2 - * Device Tree Source for AMCC Haleakala (405EXr) 3 - * 4 - * Copyright 2008 DENX Software Engineering, Stefan Roese <sr@denx.de> 5 - * 6 - * This file is licensed under the terms of the GNU General Public 7 - * License version 2. This program is licensed "as is" without 8 - * any warranty of any kind, whether express or implied. 9 - */ 10 - 11 - /dts-v1/; 12 - 13 - / { 14 - #address-cells = <1>; 15 - #size-cells = <1>; 16 - model = "amcc,haleakala"; 17 - compatible = "amcc,haleakala", "amcc,kilauea"; 18 - dcr-parent = <&{/cpus/cpu@0}>; 19 - 20 - aliases { 21 - ethernet0 = &EMAC0; 22 - serial0 = &UART0; 23 - serial1 = &UART1; 24 - }; 25 - 26 - cpus { 27 - #address-cells = <1>; 28 - #size-cells = <0>; 29 - 30 - cpu@0 { 31 - device_type = "cpu"; 32 - model = "PowerPC,405EXr"; 33 - reg = <0x00000000>; 34 - clock-frequency = <0>; /* Filled in by U-Boot */ 35 - timebase-frequency = <0>; /* Filled in by U-Boot */ 36 - i-cache-line-size = <32>; 37 - d-cache-line-size = <32>; 38 - i-cache-size = <16384>; /* 16 kB */ 39 - d-cache-size = <16384>; /* 16 kB */ 40 - dcr-controller; 41 - dcr-access-method = "native"; 42 - }; 43 - }; 44 - 45 - memory { 46 - device_type = "memory"; 47 - reg = <0x00000000 0x00000000>; /* Filled in by U-Boot */ 48 - }; 49 - 50 - UIC0: interrupt-controller { 51 - compatible = "ibm,uic-405exr", "ibm,uic"; 52 - interrupt-controller; 53 - cell-index = <0>; 54 - dcr-reg = <0x0c0 0x009>; 55 - #address-cells = <0>; 56 - #size-cells = <0>; 57 - #interrupt-cells = <2>; 58 - }; 59 - 60 - UIC1: interrupt-controller1 { 61 - compatible = "ibm,uic-405exr","ibm,uic"; 62 - interrupt-controller; 63 - cell-index = <1>; 64 - dcr-reg = <0x0d0 0x009>; 65 - #address-cells = <0>; 66 - #size-cells = <0>; 67 - #interrupt-cells = <2>; 68 - interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */ 69 - interrupt-parent = <&UIC0>; 70 - }; 71 - 72 - UIC2: interrupt-controller2 { 73 - compatible = "ibm,uic-405exr","ibm,uic"; 74 - interrupt-controller; 75 - cell-index = <2>; 76 - dcr-reg = <0x0e0 0x009>; 77 - #address-cells = <0>; 78 - #size-cells = <0>; 79 - #interrupt-cells = <2>; 80 - interrupts = <0x1c 0x4 0x1d 0x4>; /* cascade */ 81 - interrupt-parent = <&UIC0>; 82 - }; 83 - 84 - plb { 85 - compatible = "ibm,plb-405exr", "ibm,plb4"; 86 - #address-cells = <1>; 87 - #size-cells = <1>; 88 - ranges; 89 - clock-frequency = <0>; /* Filled in by U-Boot */ 90 - 91 - SDRAM0: memory-controller { 92 - compatible = "ibm,sdram-405exr", "ibm,sdram-4xx-ddr2"; 93 - dcr-reg = <0x010 0x002>; 94 - interrupt-parent = <&UIC2>; 95 - interrupts = <0x5 0x4 /* ECC DED Error */ 96 - 0x6 0x4>; /* ECC SEC Error */ 97 - }; 98 - 99 - MAL0: mcmal { 100 - compatible = "ibm,mcmal-405exr", "ibm,mcmal2"; 101 - dcr-reg = <0x180 0x062>; 102 - num-tx-chans = <2>; 103 - num-rx-chans = <2>; 104 - interrupt-parent = <&MAL0>; 105 - interrupts = <0x0 0x1 0x2 0x3 0x4>; 106 - #interrupt-cells = <1>; 107 - #address-cells = <0>; 108 - #size-cells = <0>; 109 - interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4 110 - /*RXEOB*/ 0x1 &UIC0 0xb 0x4 111 - /*SERR*/ 0x2 &UIC1 0x0 0x4 112 - /*TXDE*/ 0x3 &UIC1 0x1 0x4 113 - /*RXDE*/ 0x4 &UIC1 0x2 0x4>; 114 - interrupt-map-mask = <0xffffffff>; 115 - }; 116 - 117 - POB0: opb { 118 - compatible = "ibm,opb-405exr", "ibm,opb"; 119 - #address-cells = <1>; 120 - #size-cells = <1>; 121 - ranges = <0x80000000 0x80000000 0x10000000 122 - 0xef600000 0xef600000 0x00a00000 123 - 0xf0000000 0xf0000000 0x10000000>; 124 - dcr-reg = <0x0a0 0x005>; 125 - clock-frequency = <0>; /* Filled in by U-Boot */ 126 - 127 - EBC0: ebc { 128 - compatible = "ibm,ebc-405exr", "ibm,ebc"; 129 - dcr-reg = <0x012 0x002>; 130 - #address-cells = <2>; 131 - #size-cells = <1>; 132 - clock-frequency = <0>; /* Filled in by U-Boot */ 133 - /* ranges property is supplied by U-Boot */ 134 - interrupts = <0x5 0x1>; 135 - interrupt-parent = <&UIC1>; 136 - 137 - nor_flash@0,0 { 138 - compatible = "amd,s29gl512n", "cfi-flash"; 139 - bank-width = <2>; 140 - reg = <0x00000000 0x00000000 0x04000000>; 141 - #address-cells = <1>; 142 - #size-cells = <1>; 143 - partition@0 { 144 - label = "kernel"; 145 - reg = <0x00000000 0x00200000>; 146 - }; 147 - partition@200000 { 148 - label = "root"; 149 - reg = <0x00200000 0x00200000>; 150 - }; 151 - partition@400000 { 152 - label = "user"; 153 - reg = <0x00400000 0x03b60000>; 154 - }; 155 - partition@3f60000 { 156 - label = "env"; 157 - reg = <0x03f60000 0x00040000>; 158 - }; 159 - partition@3fa0000 { 160 - label = "u-boot"; 161 - reg = <0x03fa0000 0x00060000>; 162 - }; 163 - }; 164 - }; 165 - 166 - UART0: serial@ef600200 { 167 - device_type = "serial"; 168 - compatible = "ns16550"; 169 - reg = <0xef600200 0x00000008>; 170 - virtual-reg = <0xef600200>; 171 - clock-frequency = <0>; /* Filled in by U-Boot */ 172 - current-speed = <0>; 173 - interrupt-parent = <&UIC0>; 174 - interrupts = <0x1a 0x4>; 175 - }; 176 - 177 - UART1: serial@ef600300 { 178 - device_type = "serial"; 179 - compatible = "ns16550"; 180 - reg = <0xef600300 0x00000008>; 181 - virtual-reg = <0xef600300>; 182 - clock-frequency = <0>; /* Filled in by U-Boot */ 183 - current-speed = <0>; 184 - interrupt-parent = <&UIC0>; 185 - interrupts = <0x1 0x4>; 186 - }; 187 - 188 - IIC0: i2c@ef600400 { 189 - compatible = "ibm,iic-405exr", "ibm,iic"; 190 - reg = <0xef600400 0x00000014>; 191 - interrupt-parent = <&UIC0>; 192 - interrupts = <0x2 0x4>; 193 - }; 194 - 195 - IIC1: i2c@ef600500 { 196 - compatible = "ibm,iic-405exr", "ibm,iic"; 197 - reg = <0xef600500 0x00000014>; 198 - interrupt-parent = <&UIC0>; 199 - interrupts = <0x7 0x4>; 200 - }; 201 - 202 - 203 - RGMII0: emac-rgmii@ef600b00 { 204 - compatible = "ibm,rgmii-405exr", "ibm,rgmii"; 205 - reg = <0xef600b00 0x00000104>; 206 - has-mdio; 207 - }; 208 - 209 - EMAC0: ethernet@ef600900 { 210 - linux,network-index = <0x0>; 211 - device_type = "network"; 212 - compatible = "ibm,emac-405exr", "ibm,emac4sync"; 213 - interrupt-parent = <&EMAC0>; 214 - interrupts = <0x0 0x1>; 215 - #interrupt-cells = <1>; 216 - #address-cells = <0>; 217 - #size-cells = <0>; 218 - interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4 219 - /*Wake*/ 0x1 &UIC1 0x1d 0x4>; 220 - reg = <0xef600900 0x000000c4>; 221 - local-mac-address = [000000000000]; /* Filled in by U-Boot */ 222 - mal-device = <&MAL0>; 223 - mal-tx-channel = <0>; 224 - mal-rx-channel = <0>; 225 - cell-index = <0>; 226 - max-frame-size = <9000>; 227 - rx-fifo-size = <4096>; 228 - tx-fifo-size = <2048>; 229 - rx-fifo-size-gige = <16384>; 230 - tx-fifo-size-gige = <16384>; 231 - phy-mode = "rgmii"; 232 - phy-map = <0x00000000>; 233 - rgmii-device = <&RGMII0>; 234 - rgmii-channel = <0>; 235 - has-inverted-stacr-oc; 236 - has-new-stacr-staopc; 237 - }; 238 - }; 239 - 240 - PCIE0: pcie@a0000000 { 241 - device_type = "pci"; 242 - #interrupt-cells = <1>; 243 - #size-cells = <2>; 244 - #address-cells = <3>; 245 - compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex"; 246 - primary; 247 - port = <0x0>; /* port number */ 248 - reg = <0xa0000000 0x20000000 /* Config space access */ 249 - 0xef000000 0x00001000>; /* Registers */ 250 - dcr-reg = <0x040 0x020>; 251 - sdr-base = <0x400>; 252 - 253 - /* Outbound ranges, one memory and one IO, 254 - * later cannot be changed 255 - */ 256 - ranges = <0x02000000 0x00000000 0x80000000 0x90000000 0x00000000 0x08000000 257 - 0x01000000 0x00000000 0x00000000 0xe0000000 0x00000000 0x00010000>; 258 - 259 - /* Inbound 2GB range starting at 0 */ 260 - dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>; 261 - 262 - /* This drives busses 0x00 to 0x3f */ 263 - bus-range = <0x0 0x3f>; 264 - 265 - /* Legacy interrupts (note the weird polarity, the bridge seems 266 - * to invert PCIe legacy interrupts). 267 - * We are de-swizzling here because the numbers are actually for 268 - * port of the root complex virtual P2P bridge. But I want 269 - * to avoid putting a node for it in the tree, so the numbers 270 - * below are basically de-swizzled numbers. 271 - * The real slot is on idsel 0, so the swizzling is 1:1 272 - */ 273 - interrupt-map-mask = <0x0 0x0 0x0 0x7>; 274 - interrupt-map = < 275 - 0x0 0x0 0x0 0x1 &UIC2 0x0 0x4 /* swizzled int A */ 276 - 0x0 0x0 0x0 0x2 &UIC2 0x1 0x4 /* swizzled int B */ 277 - 0x0 0x0 0x0 0x3 &UIC2 0x2 0x4 /* swizzled int C */ 278 - 0x0 0x0 0x0 0x4 &UIC2 0x3 0x4 /* swizzled int D */>; 279 - }; 280 - }; 281 - };
-296
arch/powerpc/boot/dts/hotfoot.dts
··· 1 - /* 2 - * Device Tree Source for ESTeem 195E Hotfoot 3 - * 4 - * Copyright 2009 AbsoluteValue Systems <solomon@linux-wlan.com> 5 - * 6 - * This file is licensed under the terms of the GNU General Public 7 - * License version 2. This program is licensed "as is" without 8 - * any warranty of any kind, whether express or implied. 9 - */ 10 - 11 - /dts-v1/; 12 - 13 - / { 14 - #address-cells = <1>; 15 - #size-cells = <1>; 16 - model = "est,hotfoot"; 17 - compatible = "est,hotfoot"; 18 - dcr-parent = <&{/cpus/cpu@0}>; 19 - 20 - aliases { 21 - ethernet0 = &EMAC0; 22 - ethernet1 = &EMAC1; 23 - serial0 = &UART0; 24 - serial1 = &UART1; 25 - }; 26 - 27 - cpus { 28 - #address-cells = <1>; 29 - #size-cells = <0>; 30 - 31 - cpu@0 { 32 - device_type = "cpu"; 33 - model = "PowerPC,405EP"; 34 - reg = <0x00000000>; 35 - clock-frequency = <0>; /* Filled in by zImage */ 36 - timebase-frequency = <0>; /* Filled in by zImage */ 37 - i-cache-line-size = <0x20>; 38 - d-cache-line-size = <0x20>; 39 - i-cache-size = <0x4000>; 40 - d-cache-size = <0x4000>; 41 - dcr-controller; 42 - dcr-access-method = "native"; 43 - }; 44 - }; 45 - 46 - memory { 47 - device_type = "memory"; 48 - reg = <0x00000000 0x00000000>; /* Filled in by zImage */ 49 - }; 50 - 51 - UIC0: interrupt-controller { 52 - compatible = "ibm,uic"; 53 - interrupt-controller; 54 - cell-index = <0>; 55 - dcr-reg = <0x0c0 0x009>; 56 - #address-cells = <0>; 57 - #size-cells = <0>; 58 - #interrupt-cells = <2>; 59 - }; 60 - 61 - plb { 62 - compatible = "ibm,plb3"; 63 - #address-cells = <1>; 64 - #size-cells = <1>; 65 - ranges; 66 - clock-frequency = <0>; /* Filled in by zImage */ 67 - 68 - SDRAM0: memory-controller { 69 - compatible = "ibm,sdram-405ep"; 70 - dcr-reg = <0x010 0x002>; 71 - }; 72 - 73 - MAL: mcmal { 74 - compatible = "ibm,mcmal-405ep", "ibm,mcmal"; 75 - dcr-reg = <0x180 0x062>; 76 - num-tx-chans = <4>; 77 - num-rx-chans = <2>; 78 - interrupt-parent = <&UIC0>; 79 - interrupts = < 80 - 0xb 0x4 /* TXEOB */ 81 - 0xc 0x4 /* RXEOB */ 82 - 0xa 0x4 /* SERR */ 83 - 0xd 0x4 /* TXDE */ 84 - 0xe 0x4 /* RXDE */>; 85 - }; 86 - 87 - POB0: opb { 88 - compatible = "ibm,opb-405ep", "ibm,opb"; 89 - #address-cells = <1>; 90 - #size-cells = <1>; 91 - ranges = <0xef600000 0xef600000 0x00a00000>; 92 - dcr-reg = <0x0a0 0x005>; 93 - clock-frequency = <0>; /* Filled in by zImage */ 94 - 95 - /* Hotfoot has UART0/UART1 swapped */ 96 - 97 - UART0: serial@ef600400 { 98 - device_type = "serial"; 99 - compatible = "ns16550"; 100 - reg = <0xef600400 0x00000008>; 101 - virtual-reg = <0xef600400>; 102 - clock-frequency = <0>; /* Filled in by zImage */ 103 - current-speed = <0x9600>; 104 - interrupt-parent = <&UIC0>; 105 - interrupts = <0x1 0x4>; 106 - }; 107 - 108 - UART1: serial@ef600300 { 109 - device_type = "serial"; 110 - compatible = "ns16550"; 111 - reg = <0xef600300 0x00000008>; 112 - virtual-reg = <0xef600300>; 113 - clock-frequency = <0>; /* Filled in by zImage */ 114 - current-speed = <0x9600>; 115 - interrupt-parent = <&UIC0>; 116 - interrupts = <0x0 0x4>; 117 - }; 118 - 119 - IIC: i2c@ef600500 { 120 - #address-cells = <1>; 121 - #size-cells = <0>; 122 - compatible = "ibm,iic-405ep", "ibm,iic"; 123 - reg = <0xef600500 0x00000011>; 124 - interrupt-parent = <&UIC0>; 125 - interrupts = <0x2 0x4>; 126 - 127 - rtc@68 { 128 - /* Actually a DS1339 */ 129 - compatible = "dallas,ds1307"; 130 - reg = <0x68>; 131 - }; 132 - 133 - temp@4a { 134 - /* Not present on all boards */ 135 - compatible = "national,lm75"; 136 - reg = <0x4a>; 137 - }; 138 - }; 139 - 140 - GPIO: gpio@ef600700 { 141 - #gpio-cells = <2>; 142 - compatible = "ibm,ppc4xx-gpio"; 143 - reg = <0xef600700 0x00000020>; 144 - gpio-controller; 145 - }; 146 - 147 - gpio-leds { 148 - compatible = "gpio-leds"; 149 - status { 150 - label = "Status"; 151 - gpios = <&GPIO 1 0>; 152 - }; 153 - radiorx { 154 - label = "Rx"; 155 - gpios = <&GPIO 0xe 0>; 156 - }; 157 - }; 158 - 159 - EMAC0: ethernet@ef600800 { 160 - linux,network-index = <0x0>; 161 - device_type = "network"; 162 - compatible = "ibm,emac-405ep", "ibm,emac"; 163 - interrupt-parent = <&UIC0>; 164 - interrupts = < 165 - 0xf 0x4 /* Ethernet */ 166 - 0x9 0x4 /* Ethernet Wake Up */>; 167 - local-mac-address = [000000000000]; /* Filled in by zImage */ 168 - reg = <0xef600800 0x00000070>; 169 - mal-device = <&MAL>; 170 - mal-tx-channel = <0>; 171 - mal-rx-channel = <0>; 172 - cell-index = <0>; 173 - max-frame-size = <0x5dc>; 174 - rx-fifo-size = <0x1000>; 175 - tx-fifo-size = <0x800>; 176 - phy-mode = "mii"; 177 - phy-map = <0x00000000>; 178 - }; 179 - 180 - EMAC1: ethernet@ef600900 { 181 - linux,network-index = <0x1>; 182 - device_type = "network"; 183 - compatible = "ibm,emac-405ep", "ibm,emac"; 184 - interrupt-parent = <&UIC0>; 185 - interrupts = < 186 - 0x11 0x4 /* Ethernet */ 187 - 0x9 0x4 /* Ethernet Wake Up */>; 188 - local-mac-address = [000000000000]; /* Filled in by zImage */ 189 - reg = <0xef600900 0x00000070>; 190 - mal-device = <&MAL>; 191 - mal-tx-channel = <2>; 192 - mal-rx-channel = <1>; 193 - cell-index = <1>; 194 - max-frame-size = <0x5dc>; 195 - rx-fifo-size = <0x1000>; 196 - tx-fifo-size = <0x800>; 197 - mdio-device = <&EMAC0>; 198 - phy-mode = "mii"; 199 - phy-map = <0x0000001>; 200 - }; 201 - }; 202 - 203 - EBC0: ebc { 204 - compatible = "ibm,ebc-405ep", "ibm,ebc"; 205 - dcr-reg = <0x012 0x002>; 206 - #address-cells = <2>; 207 - #size-cells = <1>; 208 - 209 - /* The ranges property is supplied by the bootwrapper 210 - * and is based on the firmware's configuration of the 211 - * EBC bridge 212 - */ 213 - clock-frequency = <0>; /* Filled in by zImage */ 214 - 215 - nor_flash@0 { 216 - compatible = "cfi-flash"; 217 - bank-width = <2>; 218 - reg = <0x0 0xff800000 0x00800000>; 219 - #address-cells = <1>; 220 - #size-cells = <1>; 221 - 222 - /* This mapping is for the 8M flash 223 - 4M flash has all ofssets -= 4M, 224 - and FeatFS partition is not present */ 225 - partition@0 { 226 - label = "Bootloader"; 227 - reg = <0x7c0000 0x40000>; 228 - /* read-only; */ 229 - }; 230 - partition@1 { 231 - label = "Env_and_Config_Primary"; 232 - reg = <0x400000 0x10000>; 233 - }; 234 - partition@2 { 235 - label = "Kernel"; 236 - reg = <0x420000 0x100000>; 237 - }; 238 - partition@3 { 239 - label = "Filesystem"; 240 - reg = <0x520000 0x2a0000>; 241 - }; 242 - partition@4 { 243 - label = "Env_and_Config_Secondary"; 244 - reg = <0x410000 0x10000>; 245 - }; 246 - partition@5 { 247 - label = "FeatFS"; 248 - reg = <0x000000 0x400000>; 249 - }; 250 - partition@6 { 251 - label = "Bootloader_Env"; 252 - reg = <0x7d0000 0x10000>; 253 - }; 254 - }; 255 - }; 256 - 257 - PCI0: pci@ec000000 { 258 - device_type = "pci"; 259 - #interrupt-cells = <1>; 260 - #size-cells = <2>; 261 - #address-cells = <3>; 262 - compatible = "ibm,plb405ep-pci", "ibm,plb-pci"; 263 - primary; 264 - reg = <0xeec00000 0x00000008 /* Config space access */ 265 - 0xeed80000 0x00000004 /* IACK */ 266 - 0xeed80000 0x00000004 /* Special cycle */ 267 - 0xef480000 0x00000040>; /* Internal registers */ 268 - 269 - /* Outbound ranges, one memory and one IO, 270 - * later cannot be changed. Chip supports a second 271 - * IO range but we don't use it for now 272 - */ 273 - ranges = <0x02000000 0x00000000 0x80000000 0x80000000 0x00000000 0x20000000 274 - 0x01000000 0x00000000 0x00000000 0xe8000000 0x00000000 0x00010000>; 275 - 276 - /* Inbound 2GB range starting at 0 */ 277 - dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>; 278 - 279 - interrupt-parent = <&UIC0>; 280 - interrupt-map-mask = <0xf800 0x0 0x0 0x7>; 281 - interrupt-map = < 282 - /* IDSEL 3 -- slot1 (optional) 27/29 A/B IRQ2/4 */ 283 - 0x1800 0x0 0x0 0x1 &UIC0 0x1b 0x8 284 - 0x1800 0x0 0x0 0x2 &UIC0 0x1d 0x8 285 - 286 - /* IDSEL 4 -- slot0, 26/28 A/B IRQ1/3 */ 287 - 0x2000 0x0 0x0 0x1 &UIC0 0x1a 0x8 288 - 0x2000 0x0 0x0 0x2 &UIC0 0x1c 0x8 289 - >; 290 - }; 291 - }; 292 - 293 - chosen { 294 - stdout-path = &UART0; 295 - }; 296 - };
-407
arch/powerpc/boot/dts/kilauea.dts
··· 1 - /* 2 - * Device Tree Source for AMCC Kilauea (405EX) 3 - * 4 - * Copyright 2007-2009 DENX Software Engineering, Stefan Roese <sr@denx.de> 5 - * 6 - * This file is licensed under the terms of the GNU General Public 7 - * License version 2. This program is licensed "as is" without 8 - * any warranty of any kind, whether express or implied. 9 - */ 10 - 11 - /dts-v1/; 12 - 13 - / { 14 - #address-cells = <1>; 15 - #size-cells = <1>; 16 - model = "amcc,kilauea"; 17 - compatible = "amcc,kilauea"; 18 - dcr-parent = <&{/cpus/cpu@0}>; 19 - 20 - aliases { 21 - ethernet0 = &EMAC0; 22 - ethernet1 = &EMAC1; 23 - serial0 = &UART0; 24 - serial1 = &UART1; 25 - }; 26 - 27 - cpus { 28 - #address-cells = <1>; 29 - #size-cells = <0>; 30 - 31 - cpu@0 { 32 - device_type = "cpu"; 33 - model = "PowerPC,405EX"; 34 - reg = <0x00000000>; 35 - clock-frequency = <0>; /* Filled in by U-Boot */ 36 - timebase-frequency = <0>; /* Filled in by U-Boot */ 37 - i-cache-line-size = <32>; 38 - d-cache-line-size = <32>; 39 - i-cache-size = <16384>; /* 16 kB */ 40 - d-cache-size = <16384>; /* 16 kB */ 41 - dcr-controller; 42 - dcr-access-method = "native"; 43 - }; 44 - }; 45 - 46 - memory { 47 - device_type = "memory"; 48 - reg = <0x00000000 0x00000000>; /* Filled in by U-Boot */ 49 - }; 50 - 51 - UIC0: interrupt-controller { 52 - compatible = "ibm,uic-405ex", "ibm,uic"; 53 - interrupt-controller; 54 - cell-index = <0>; 55 - dcr-reg = <0x0c0 0x009>; 56 - #address-cells = <0>; 57 - #size-cells = <0>; 58 - #interrupt-cells = <2>; 59 - }; 60 - 61 - UIC1: interrupt-controller1 { 62 - compatible = "ibm,uic-405ex","ibm,uic"; 63 - interrupt-controller; 64 - cell-index = <1>; 65 - dcr-reg = <0x0d0 0x009>; 66 - #address-cells = <0>; 67 - #size-cells = <0>; 68 - #interrupt-cells = <2>; 69 - interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */ 70 - interrupt-parent = <&UIC0>; 71 - }; 72 - 73 - UIC2: interrupt-controller2 { 74 - compatible = "ibm,uic-405ex","ibm,uic"; 75 - interrupt-controller; 76 - cell-index = <2>; 77 - dcr-reg = <0x0e0 0x009>; 78 - #address-cells = <0>; 79 - #size-cells = <0>; 80 - #interrupt-cells = <2>; 81 - interrupts = <0x1c 0x4 0x1d 0x4>; /* cascade */ 82 - interrupt-parent = <&UIC0>; 83 - }; 84 - 85 - CPM0: cpm { 86 - compatible = "ibm,cpm"; 87 - dcr-access-method = "native"; 88 - dcr-reg = <0x0b0 0x003>; 89 - unused-units = <0x00000000>; 90 - idle-doze = <0x02000000>; 91 - standby = <0xe3e74800>; 92 - }; 93 - 94 - plb { 95 - compatible = "ibm,plb-405ex", "ibm,plb4"; 96 - #address-cells = <1>; 97 - #size-cells = <1>; 98 - ranges; 99 - clock-frequency = <0>; /* Filled in by U-Boot */ 100 - 101 - SDRAM0: memory-controller { 102 - compatible = "ibm,sdram-405ex", "ibm,sdram-4xx-ddr2"; 103 - dcr-reg = <0x010 0x002>; 104 - interrupt-parent = <&UIC2>; 105 - interrupts = <0x5 0x4 /* ECC DED Error */ 106 - 0x6 0x4>; /* ECC SEC Error */ 107 - }; 108 - 109 - CRYPTO: crypto@ef700000 { 110 - compatible = "amcc,ppc405ex-crypto", "amcc,ppc4xx-crypto"; 111 - reg = <0xef700000 0x80400>; 112 - interrupt-parent = <&UIC0>; 113 - interrupts = <0x17 0x2>; 114 - }; 115 - 116 - MAL0: mcmal { 117 - compatible = "ibm,mcmal-405ex", "ibm,mcmal2"; 118 - dcr-reg = <0x180 0x062>; 119 - num-tx-chans = <2>; 120 - num-rx-chans = <2>; 121 - interrupt-parent = <&MAL0>; 122 - interrupts = <0x0 0x1 0x2 0x3 0x4>; 123 - #interrupt-cells = <1>; 124 - #address-cells = <0>; 125 - #size-cells = <0>; 126 - interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4 127 - /*RXEOB*/ 0x1 &UIC0 0xb 0x4 128 - /*SERR*/ 0x2 &UIC1 0x0 0x4 129 - /*TXDE*/ 0x3 &UIC1 0x1 0x4 130 - /*RXDE*/ 0x4 &UIC1 0x2 0x4>; 131 - interrupt-map-mask = <0xffffffff>; 132 - }; 133 - 134 - POB0: opb { 135 - compatible = "ibm,opb-405ex", "ibm,opb"; 136 - #address-cells = <1>; 137 - #size-cells = <1>; 138 - ranges = <0x80000000 0x80000000 0x10000000 139 - 0xef600000 0xef600000 0x00a00000 140 - 0xf0000000 0xf0000000 0x10000000>; 141 - dcr-reg = <0x0a0 0x005>; 142 - clock-frequency = <0>; /* Filled in by U-Boot */ 143 - 144 - EBC0: ebc { 145 - compatible = "ibm,ebc-405ex", "ibm,ebc"; 146 - dcr-reg = <0x012 0x002>; 147 - #address-cells = <2>; 148 - #size-cells = <1>; 149 - clock-frequency = <0>; /* Filled in by U-Boot */ 150 - /* ranges property is supplied by U-Boot */ 151 - interrupts = <0x5 0x1>; 152 - interrupt-parent = <&UIC1>; 153 - 154 - nor_flash@0,0 { 155 - compatible = "amd,s29gl512n", "cfi-flash"; 156 - bank-width = <2>; 157 - reg = <0x00000000 0x00000000 0x04000000>; 158 - #address-cells = <1>; 159 - #size-cells = <1>; 160 - partition@0 { 161 - label = "kernel"; 162 - reg = <0x00000000 0x001e0000>; 163 - }; 164 - partition@1e0000 { 165 - label = "dtb"; 166 - reg = <0x001e0000 0x00020000>; 167 - }; 168 - partition@200000 { 169 - label = "root"; 170 - reg = <0x00200000 0x00200000>; 171 - }; 172 - partition@400000 { 173 - label = "user"; 174 - reg = <0x00400000 0x03b60000>; 175 - }; 176 - partition@3f60000 { 177 - label = "env"; 178 - reg = <0x03f60000 0x00040000>; 179 - }; 180 - partition@3fa0000 { 181 - label = "u-boot"; 182 - reg = <0x03fa0000 0x00060000>; 183 - }; 184 - }; 185 - 186 - ndfc@1,0 { 187 - compatible = "ibm,ndfc"; 188 - reg = <0x00000001 0x00000000 0x00002000>; 189 - ccr = <0x00001000>; 190 - bank-settings = <0x80002222>; 191 - #address-cells = <1>; 192 - #size-cells = <1>; 193 - 194 - nand { 195 - #address-cells = <1>; 196 - #size-cells = <1>; 197 - 198 - partition@0 { 199 - label = "u-boot"; 200 - reg = <0x00000000 0x00100000>; 201 - }; 202 - partition@100000 { 203 - label = "user"; 204 - reg = <0x00000000 0x03f00000>; 205 - }; 206 - }; 207 - }; 208 - }; 209 - 210 - UART0: serial@ef600200 { 211 - device_type = "serial"; 212 - compatible = "ns16550"; 213 - reg = <0xef600200 0x00000008>; 214 - virtual-reg = <0xef600200>; 215 - clock-frequency = <0>; /* Filled in by U-Boot */ 216 - current-speed = <0>; 217 - interrupt-parent = <&UIC0>; 218 - interrupts = <0x1a 0x4>; 219 - }; 220 - 221 - UART1: serial@ef600300 { 222 - device_type = "serial"; 223 - compatible = "ns16550"; 224 - reg = <0xef600300 0x00000008>; 225 - virtual-reg = <0xef600300>; 226 - clock-frequency = <0>; /* Filled in by U-Boot */ 227 - current-speed = <0>; 228 - interrupt-parent = <&UIC0>; 229 - interrupts = <0x1 0x4>; 230 - }; 231 - 232 - IIC0: i2c@ef600400 { 233 - compatible = "ibm,iic-405ex", "ibm,iic"; 234 - reg = <0xef600400 0x00000014>; 235 - interrupt-parent = <&UIC0>; 236 - interrupts = <0x2 0x4>; 237 - #address-cells = <1>; 238 - #size-cells = <0>; 239 - 240 - rtc@68 { 241 - compatible = "dallas,ds1338"; 242 - reg = <0x68>; 243 - }; 244 - 245 - dtt@48 { 246 - compatible = "dallas,ds1775"; 247 - reg = <0x48>; 248 - }; 249 - }; 250 - 251 - IIC1: i2c@ef600500 { 252 - compatible = "ibm,iic-405ex", "ibm,iic"; 253 - reg = <0xef600500 0x00000014>; 254 - interrupt-parent = <&UIC0>; 255 - interrupts = <0x7 0x4>; 256 - }; 257 - 258 - RGMII0: emac-rgmii@ef600b00 { 259 - compatible = "ibm,rgmii-405ex", "ibm,rgmii"; 260 - reg = <0xef600b00 0x00000104>; 261 - has-mdio; 262 - }; 263 - 264 - EMAC0: ethernet@ef600900 { 265 - linux,network-index = <0x0>; 266 - device_type = "network"; 267 - compatible = "ibm,emac-405ex", "ibm,emac4sync"; 268 - interrupt-parent = <&EMAC0>; 269 - interrupts = <0x0 0x1>; 270 - #interrupt-cells = <1>; 271 - #address-cells = <0>; 272 - #size-cells = <0>; 273 - interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4 274 - /*Wake*/ 0x1 &UIC1 0x1d 0x4>; 275 - reg = <0xef600900 0x000000c4>; 276 - local-mac-address = [000000000000]; /* Filled in by U-Boot */ 277 - mal-device = <&MAL0>; 278 - mal-tx-channel = <0>; 279 - mal-rx-channel = <0>; 280 - cell-index = <0>; 281 - max-frame-size = <9000>; 282 - rx-fifo-size = <4096>; 283 - tx-fifo-size = <2048>; 284 - rx-fifo-size-gige = <16384>; 285 - tx-fifo-size-gige = <16384>; 286 - phy-mode = "rgmii"; 287 - phy-map = <0x00000000>; 288 - rgmii-device = <&RGMII0>; 289 - rgmii-channel = <0>; 290 - has-inverted-stacr-oc; 291 - has-new-stacr-staopc; 292 - }; 293 - 294 - EMAC1: ethernet@ef600a00 { 295 - linux,network-index = <0x1>; 296 - device_type = "network"; 297 - compatible = "ibm,emac-405ex", "ibm,emac4sync"; 298 - interrupt-parent = <&EMAC1>; 299 - interrupts = <0x0 0x1>; 300 - #interrupt-cells = <1>; 301 - #address-cells = <0>; 302 - #size-cells = <0>; 303 - interrupt-map = </*Status*/ 0x0 &UIC0 0x19 0x4 304 - /*Wake*/ 0x1 &UIC1 0x1f 0x4>; 305 - reg = <0xef600a00 0x000000c4>; 306 - local-mac-address = [000000000000]; /* Filled in by U-Boot */ 307 - mal-device = <&MAL0>; 308 - mal-tx-channel = <1>; 309 - mal-rx-channel = <1>; 310 - cell-index = <1>; 311 - max-frame-size = <9000>; 312 - rx-fifo-size = <4096>; 313 - tx-fifo-size = <2048>; 314 - rx-fifo-size-gige = <16384>; 315 - tx-fifo-size-gige = <16384>; 316 - phy-mode = "rgmii"; 317 - phy-map = <0x00000000>; 318 - rgmii-device = <&RGMII0>; 319 - rgmii-channel = <1>; 320 - has-inverted-stacr-oc; 321 - has-new-stacr-staopc; 322 - }; 323 - }; 324 - 325 - PCIE0: pcie@a0000000 { 326 - device_type = "pci"; 327 - #interrupt-cells = <1>; 328 - #size-cells = <2>; 329 - #address-cells = <3>; 330 - compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex"; 331 - primary; 332 - port = <0x0>; /* port number */ 333 - reg = <0xa0000000 0x20000000 /* Config space access */ 334 - 0xef000000 0x00001000>; /* Registers */ 335 - dcr-reg = <0x040 0x020>; 336 - sdr-base = <0x400>; 337 - 338 - /* Outbound ranges, one memory and one IO, 339 - * later cannot be changed 340 - */ 341 - ranges = <0x02000000 0x00000000 0x80000000 0x90000000 0x00000000 0x08000000 342 - 0x01000000 0x00000000 0x00000000 0xe0000000 0x00000000 0x00010000>; 343 - 344 - /* Inbound 2GB range starting at 0 */ 345 - dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>; 346 - 347 - /* This drives busses 0x00 to 0x3f */ 348 - bus-range = <0x0 0x3f>; 349 - 350 - /* Legacy interrupts (note the weird polarity, the bridge seems 351 - * to invert PCIe legacy interrupts). 352 - * We are de-swizzling here because the numbers are actually for 353 - * port of the root complex virtual P2P bridge. But I want 354 - * to avoid putting a node for it in the tree, so the numbers 355 - * below are basically de-swizzled numbers. 356 - * The real slot is on idsel 0, so the swizzling is 1:1 357 - */ 358 - interrupt-map-mask = <0x0 0x0 0x0 0x7>; 359 - interrupt-map = < 360 - 0x0 0x0 0x0 0x1 &UIC2 0x0 0x4 /* swizzled int A */ 361 - 0x0 0x0 0x0 0x2 &UIC2 0x1 0x4 /* swizzled int B */ 362 - 0x0 0x0 0x0 0x3 &UIC2 0x2 0x4 /* swizzled int C */ 363 - 0x0 0x0 0x0 0x4 &UIC2 0x3 0x4 /* swizzled int D */>; 364 - }; 365 - 366 - PCIE1: pcie@c0000000 { 367 - device_type = "pci"; 368 - #interrupt-cells = <1>; 369 - #size-cells = <2>; 370 - #address-cells = <3>; 371 - compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex"; 372 - primary; 373 - port = <0x1>; /* port number */ 374 - reg = <0xc0000000 0x20000000 /* Config space access */ 375 - 0xef001000 0x00001000>; /* Registers */ 376 - dcr-reg = <0x060 0x020>; 377 - sdr-base = <0x440>; 378 - 379 - /* Outbound ranges, one memory and one IO, 380 - * later cannot be changed 381 - */ 382 - ranges = <0x02000000 0x00000000 0x80000000 0x98000000 0x00000000 0x08000000 383 - 0x01000000 0x00000000 0x00000000 0xe0010000 0x00000000 0x00010000>; 384 - 385 - /* Inbound 2GB range starting at 0 */ 386 - dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>; 387 - 388 - /* This drives busses 0x40 to 0x7f */ 389 - bus-range = <0x40 0x7f>; 390 - 391 - /* Legacy interrupts (note the weird polarity, the bridge seems 392 - * to invert PCIe legacy interrupts). 393 - * We are de-swizzling here because the numbers are actually for 394 - * port of the root complex virtual P2P bridge. But I want 395 - * to avoid putting a node for it in the tree, so the numbers 396 - * below are basically de-swizzled numbers. 397 - * The real slot is on idsel 0, so the swizzling is 1:1 398 - */ 399 - interrupt-map-mask = <0x0 0x0 0x0 0x7>; 400 - interrupt-map = < 401 - 0x0 0x0 0x0 0x1 &UIC2 0xb 0x4 /* swizzled int A */ 402 - 0x0 0x0 0x0 0x2 &UIC2 0xc 0x4 /* swizzled int B */ 403 - 0x0 0x0 0x0 0x3 &UIC2 0xd 0x4 /* swizzled int C */ 404 - 0x0 0x0 0x0 0x4 &UIC2 0xe 0x4 /* swizzled int D */>; 405 - }; 406 - }; 407 - };
-212
arch/powerpc/boot/dts/klondike.dts
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * Device Tree for Klondike (APM8018X) board. 4 - * 5 - * Copyright (c) 2010, Applied Micro Circuits Corporation 6 - * Author: Tanmay Inamdar <tinamdar@apm.com> 7 - */ 8 - 9 - /dts-v1/; 10 - 11 - / { 12 - #address-cells = <1>; 13 - #size-cells = <1>; 14 - model = "apm,klondike"; 15 - compatible = "apm,klondike"; 16 - dcr-parent = <&{/cpus/cpu@0}>; 17 - 18 - aliases { 19 - ethernet0 = &EMAC0; 20 - ethernet1 = &EMAC1; 21 - }; 22 - 23 - cpus { 24 - #address-cells = <1>; 25 - #size-cells = <0>; 26 - 27 - cpu@0 { 28 - device_type = "cpu"; 29 - model = "PowerPC,apm8018x"; 30 - reg = <0x00000000>; 31 - clock-frequency = <300000000>; /* Filled in by U-Boot */ 32 - timebase-frequency = <300000000>; /* Filled in by U-Boot */ 33 - i-cache-line-size = <32>; 34 - d-cache-line-size = <32>; 35 - i-cache-size = <16384>; /* 16 kB */ 36 - d-cache-size = <16384>; /* 16 kB */ 37 - dcr-controller; 38 - dcr-access-method = "native"; 39 - }; 40 - }; 41 - 42 - memory { 43 - device_type = "memory"; 44 - reg = <0x00000000 0x20000000>; /* Filled in by U-Boot */ 45 - }; 46 - 47 - UIC0: interrupt-controller { 48 - compatible = "ibm,uic"; 49 - interrupt-controller; 50 - cell-index = <0>; 51 - dcr-reg = <0x0c0 0x010>; 52 - #address-cells = <0>; 53 - #size-cells = <0>; 54 - #interrupt-cells = <2>; 55 - }; 56 - 57 - UIC1: interrupt-controller1 { 58 - compatible = "ibm,uic"; 59 - interrupt-controller; 60 - cell-index = <1>; 61 - dcr-reg = <0x0d0 0x010>; 62 - #address-cells = <0>; 63 - #size-cells = <0>; 64 - #interrupt-cells = <2>; 65 - interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */ 66 - interrupt-parent = <&UIC0>; 67 - }; 68 - 69 - UIC2: interrupt-controller2 { 70 - compatible = "ibm,uic"; 71 - interrupt-controller; 72 - cell-index = <2>; 73 - dcr-reg = <0x0e0 0x010>; 74 - #address-cells = <0>; 75 - #size-cells = <0>; 76 - #interrupt-cells = <2>; 77 - interrupts = <0x0a 0x4 0x0b 0x4>; /* cascade */ 78 - interrupt-parent = <&UIC0>; 79 - }; 80 - 81 - UIC3: interrupt-controller3 { 82 - compatible = "ibm,uic"; 83 - interrupt-controller; 84 - cell-index = <3>; 85 - dcr-reg = <0x0f0 0x010>; 86 - #address-cells = <0>; 87 - #size-cells = <0>; 88 - #interrupt-cells = <2>; 89 - interrupts = <0x10 0x4 0x11 0x4>; /* cascade */ 90 - interrupt-parent = <&UIC0>; 91 - }; 92 - 93 - plb { 94 - compatible = "ibm,plb4"; 95 - #address-cells = <1>; 96 - #size-cells = <1>; 97 - ranges; 98 - clock-frequency = <0>; /* Filled in by U-Boot */ 99 - 100 - SDRAM0: memory-controller { 101 - compatible = "ibm,sdram-apm8018x"; 102 - dcr-reg = <0x010 0x002>; 103 - }; 104 - 105 - MAL0: mcmal { 106 - compatible = "ibm,mcmal2"; 107 - dcr-reg = <0x180 0x062>; 108 - num-tx-chans = <2>; 109 - num-rx-chans = <16>; 110 - #address-cells = <0>; 111 - #size-cells = <0>; 112 - interrupt-parent = <&UIC1>; 113 - interrupts = </*TXEOB*/ 0x6 0x4 114 - /*RXEOB*/ 0x7 0x4 115 - /*SERR*/ 0x1 0x4 116 - /*TXDE*/ 0x2 0x4 117 - /*RXDE*/ 0x3 0x4>; 118 - }; 119 - 120 - POB0: opb { 121 - compatible = "ibm,opb"; 122 - #address-cells = <1>; 123 - #size-cells = <1>; 124 - ranges = <0x20000000 0x20000000 0x30000000 125 - 0x50000000 0x50000000 0x10000000 126 - 0x60000000 0x60000000 0x10000000 127 - 0xFE000000 0xFE000000 0x00010000>; 128 - dcr-reg = <0x100 0x020>; 129 - clock-frequency = <300000000>; /* Filled in by U-Boot */ 130 - 131 - RGMII0: emac-rgmii@400a2000 { 132 - compatible = "ibm,rgmii"; 133 - reg = <0x400a2000 0x00000010>; 134 - has-mdio; 135 - }; 136 - 137 - TAH0: emac-tah@400a3000 { 138 - compatible = "ibm,tah"; 139 - reg = <0x400a3000 0x100>; 140 - }; 141 - 142 - TAH1: emac-tah@400a4000 { 143 - compatible = "ibm,tah"; 144 - reg = <0x400a4000 0x100>; 145 - }; 146 - 147 - EMAC0: ethernet@400a0000 { 148 - compatible = "ibm,emac4", "ibm-emac4sync"; 149 - interrupt-parent = <&EMAC0>; 150 - interrupts = <0x0>; 151 - #interrupt-cells = <1>; 152 - #address-cells = <0>; 153 - #size-cells = <0>; 154 - interrupt-map = </*Status*/ 0x0 &UIC0 0x13 0x4>; 155 - reg = <0x400a0000 0x00000100>; 156 - local-mac-address = [000000000000]; /* Filled in by U-Boot */ 157 - mal-device = <&MAL0>; 158 - mal-tx-channel = <0x0>; 159 - mal-rx-channel = <0x0>; 160 - cell-index = <0>; 161 - max-frame-size = <9000>; 162 - rx-fifo-size = <4096>; 163 - tx-fifo-size = <2048>; 164 - phy-mode = "rgmii"; 165 - phy-address = <0x2>; 166 - turbo = "no"; 167 - phy-map = <0x00000000>; 168 - rgmii-device = <&RGMII0>; 169 - rgmii-channel = <0>; 170 - tah-device = <&TAH0>; 171 - tah-channel = <0>; 172 - has-inverted-stacr-oc; 173 - has-new-stacr-staopc; 174 - }; 175 - 176 - EMAC1: ethernet@400a1000 { 177 - compatible = "ibm,emac4", "ibm-emac4sync"; 178 - status = "disabled"; 179 - interrupt-parent = <&EMAC1>; 180 - interrupts = <0x0>; 181 - #interrupt-cells = <1>; 182 - #address-cells = <0>; 183 - #size-cells = <0>; 184 - interrupt-map = </*Status*/ 0x0 &UIC0 0x14 0x4>; 185 - reg = <0x400a1000 0x00000100>; 186 - local-mac-address = [000000000000]; /* Filled in by U-Boot */ 187 - mal-device = <&MAL0>; 188 - mal-tx-channel = <1>; 189 - mal-rx-channel = <8>; 190 - cell-index = <1>; 191 - max-frame-size = <9000>; 192 - rx-fifo-size = <4096>; 193 - tx-fifo-size = <2048>; 194 - phy-mode = "rgmii"; 195 - phy-address = <0x3>; 196 - turbo = "no"; 197 - phy-map = <0x00000000>; 198 - rgmii-device = <&RGMII0>; 199 - rgmii-channel = <1>; 200 - tah-device = <&TAH1>; 201 - tah-channel = <0>; 202 - has-inverted-stacr-oc; 203 - has-new-stacr-staopc; 204 - mdio-device = <&EMAC0>; 205 - }; 206 - }; 207 - }; 208 - 209 - chosen { 210 - stdout-path = "/plb/opb/serial@50001000"; 211 - }; 212 - };
-353
arch/powerpc/boot/dts/makalu.dts
··· 1 - /* 2 - * Device Tree Source for AMCC Makalu (405EX) 3 - * 4 - * Copyright 2007 DENX Software Engineering, Stefan Roese <sr@denx.de> 5 - * 6 - * This file is licensed under the terms of the GNU General Public 7 - * License version 2. This program is licensed "as is" without 8 - * any warranty of any kind, whether express or implied. 9 - */ 10 - 11 - /dts-v1/; 12 - 13 - / { 14 - #address-cells = <1>; 15 - #size-cells = <1>; 16 - model = "amcc,makalu"; 17 - compatible = "amcc,makalu"; 18 - dcr-parent = <&{/cpus/cpu@0}>; 19 - 20 - aliases { 21 - ethernet0 = &EMAC0; 22 - ethernet1 = &EMAC1; 23 - serial0 = &UART0; 24 - serial1 = &UART1; 25 - }; 26 - 27 - cpus { 28 - #address-cells = <1>; 29 - #size-cells = <0>; 30 - 31 - cpu@0 { 32 - device_type = "cpu"; 33 - model = "PowerPC,405EX"; 34 - reg = <0x00000000>; 35 - clock-frequency = <0>; /* Filled in by U-Boot */ 36 - timebase-frequency = <0>; /* Filled in by U-Boot */ 37 - i-cache-line-size = <32>; 38 - d-cache-line-size = <32>; 39 - i-cache-size = <16384>; /* 16 kB */ 40 - d-cache-size = <16384>; /* 16 kB */ 41 - dcr-controller; 42 - dcr-access-method = "native"; 43 - }; 44 - }; 45 - 46 - memory { 47 - device_type = "memory"; 48 - reg = <0x00000000 0x00000000>; /* Filled in by U-Boot */ 49 - }; 50 - 51 - UIC0: interrupt-controller { 52 - compatible = "ibm,uic-405ex", "ibm,uic"; 53 - interrupt-controller; 54 - cell-index = <0>; 55 - dcr-reg = <0x0c0 0x009>; 56 - #address-cells = <0>; 57 - #size-cells = <0>; 58 - #interrupt-cells = <2>; 59 - }; 60 - 61 - UIC1: interrupt-controller1 { 62 - compatible = "ibm,uic-405ex","ibm,uic"; 63 - interrupt-controller; 64 - cell-index = <1>; 65 - dcr-reg = <0x0d0 0x009>; 66 - #address-cells = <0>; 67 - #size-cells = <0>; 68 - #interrupt-cells = <2>; 69 - interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */ 70 - interrupt-parent = <&UIC0>; 71 - }; 72 - 73 - UIC2: interrupt-controller2 { 74 - compatible = "ibm,uic-405ex","ibm,uic"; 75 - interrupt-controller; 76 - cell-index = <2>; 77 - dcr-reg = <0x0e0 0x009>; 78 - #address-cells = <0>; 79 - #size-cells = <0>; 80 - #interrupt-cells = <2>; 81 - interrupts = <0x1c 0x4 0x1d 0x4>; /* cascade */ 82 - interrupt-parent = <&UIC0>; 83 - }; 84 - 85 - plb { 86 - compatible = "ibm,plb-405ex", "ibm,plb4"; 87 - #address-cells = <1>; 88 - #size-cells = <1>; 89 - ranges; 90 - clock-frequency = <0>; /* Filled in by U-Boot */ 91 - 92 - SDRAM0: memory-controller { 93 - compatible = "ibm,sdram-405ex", "ibm,sdram-4xx-ddr2"; 94 - dcr-reg = <0x010 0x002>; 95 - interrupt-parent = <&UIC2>; 96 - interrupts = <0x5 0x4 /* ECC DED Error */ 97 - 0x6 0x4 /* ECC SEC Error */ >; 98 - }; 99 - 100 - MAL0: mcmal { 101 - compatible = "ibm,mcmal-405ex", "ibm,mcmal2"; 102 - dcr-reg = <0x180 0x062>; 103 - num-tx-chans = <2>; 104 - num-rx-chans = <2>; 105 - interrupt-parent = <&MAL0>; 106 - interrupts = <0x0 0x1 0x2 0x3 0x4>; 107 - #interrupt-cells = <1>; 108 - #address-cells = <0>; 109 - #size-cells = <0>; 110 - interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4 111 - /*RXEOB*/ 0x1 &UIC0 0xb 0x4 112 - /*SERR*/ 0x2 &UIC1 0x0 0x4 113 - /*TXDE*/ 0x3 &UIC1 0x1 0x4 114 - /*RXDE*/ 0x4 &UIC1 0x2 0x4>; 115 - interrupt-map-mask = <0xffffffff>; 116 - }; 117 - 118 - POB0: opb { 119 - compatible = "ibm,opb-405ex", "ibm,opb"; 120 - #address-cells = <1>; 121 - #size-cells = <1>; 122 - ranges = <0x80000000 0x80000000 0x10000000 123 - 0xef600000 0xef600000 0x00a00000 124 - 0xf0000000 0xf0000000 0x10000000>; 125 - dcr-reg = <0x0a0 0x005>; 126 - clock-frequency = <0>; /* Filled in by U-Boot */ 127 - 128 - EBC0: ebc { 129 - compatible = "ibm,ebc-405ex", "ibm,ebc"; 130 - dcr-reg = <0x012 0x002>; 131 - #address-cells = <2>; 132 - #size-cells = <1>; 133 - clock-frequency = <0>; /* Filled in by U-Boot */ 134 - /* ranges property is supplied by U-Boot */ 135 - interrupts = <0x5 0x1>; 136 - interrupt-parent = <&UIC1>; 137 - 138 - nor_flash@0,0 { 139 - compatible = "amd,s29gl512n", "cfi-flash"; 140 - bank-width = <2>; 141 - reg = <0x00000000 0x00000000 0x04000000>; 142 - #address-cells = <1>; 143 - #size-cells = <1>; 144 - partition@0 { 145 - label = "kernel"; 146 - reg = <0x00000000 0x00200000>; 147 - }; 148 - partition@200000 { 149 - label = "root"; 150 - reg = <0x00200000 0x00200000>; 151 - }; 152 - partition@400000 { 153 - label = "user"; 154 - reg = <0x00400000 0x03b60000>; 155 - }; 156 - partition@3f60000 { 157 - label = "env"; 158 - reg = <0x03f60000 0x00040000>; 159 - }; 160 - partition@3fa0000 { 161 - label = "u-boot"; 162 - reg = <0x03fa0000 0x00060000>; 163 - }; 164 - }; 165 - }; 166 - 167 - UART0: serial@ef600200 { 168 - device_type = "serial"; 169 - compatible = "ns16550"; 170 - reg = <0xef600200 0x00000008>; 171 - virtual-reg = <0xef600200>; 172 - clock-frequency = <0>; /* Filled in by U-Boot */ 173 - current-speed = <0>; 174 - interrupt-parent = <&UIC0>; 175 - interrupts = <0x1a 0x4>; 176 - }; 177 - 178 - UART1: serial@ef600300 { 179 - device_type = "serial"; 180 - compatible = "ns16550"; 181 - reg = <0xef600300 0x00000008>; 182 - virtual-reg = <0xef600300>; 183 - clock-frequency = <0>; /* Filled in by U-Boot */ 184 - current-speed = <0>; 185 - interrupt-parent = <&UIC0>; 186 - interrupts = <0x1 0x4>; 187 - }; 188 - 189 - IIC0: i2c@ef600400 { 190 - compatible = "ibm,iic-405ex", "ibm,iic"; 191 - reg = <0xef600400 0x00000014>; 192 - interrupt-parent = <&UIC0>; 193 - interrupts = <0x2 0x4>; 194 - }; 195 - 196 - IIC1: i2c@ef600500 { 197 - compatible = "ibm,iic-405ex", "ibm,iic"; 198 - reg = <0xef600500 0x00000014>; 199 - interrupt-parent = <&UIC0>; 200 - interrupts = <0x7 0x4>; 201 - }; 202 - 203 - 204 - RGMII0: emac-rgmii@ef600b00 { 205 - compatible = "ibm,rgmii-405ex", "ibm,rgmii"; 206 - reg = <0xef600b00 0x00000104>; 207 - has-mdio; 208 - }; 209 - 210 - EMAC0: ethernet@ef600900 { 211 - linux,network-index = <0x0>; 212 - device_type = "network"; 213 - compatible = "ibm,emac-405ex", "ibm,emac4sync"; 214 - interrupt-parent = <&EMAC0>; 215 - interrupts = <0x0 0x1>; 216 - #interrupt-cells = <1>; 217 - #address-cells = <0>; 218 - #size-cells = <0>; 219 - interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4 220 - /*Wake*/ 0x1 &UIC1 0x1d 0x4>; 221 - reg = <0xef600900 0x000000c4>; 222 - local-mac-address = [000000000000]; /* Filled in by U-Boot */ 223 - mal-device = <&MAL0>; 224 - mal-tx-channel = <0>; 225 - mal-rx-channel = <0>; 226 - cell-index = <0>; 227 - max-frame-size = <9000>; 228 - rx-fifo-size = <4096>; 229 - tx-fifo-size = <2048>; 230 - rx-fifo-size-gige = <16384>; 231 - tx-fifo-size-gige = <16384>; 232 - phy-mode = "rgmii"; 233 - phy-map = <0x0000003f>; /* Start at 6 */ 234 - rgmii-device = <&RGMII0>; 235 - rgmii-channel = <0>; 236 - has-inverted-stacr-oc; 237 - has-new-stacr-staopc; 238 - }; 239 - 240 - EMAC1: ethernet@ef600a00 { 241 - linux,network-index = <0x1>; 242 - device_type = "network"; 243 - compatible = "ibm,emac-405ex", "ibm,emac4sync"; 244 - interrupt-parent = <&EMAC1>; 245 - interrupts = <0x0 0x1>; 246 - #interrupt-cells = <1>; 247 - #address-cells = <0>; 248 - #size-cells = <0>; 249 - interrupt-map = </*Status*/ 0x0 &UIC0 0x19 0x4 250 - /*Wake*/ 0x1 &UIC1 0x1f 0x4>; 251 - reg = <0xef600a00 0x000000c4>; 252 - local-mac-address = [000000000000]; /* Filled in by U-Boot */ 253 - mal-device = <&MAL0>; 254 - mal-tx-channel = <1>; 255 - mal-rx-channel = <1>; 256 - cell-index = <1>; 257 - max-frame-size = <9000>; 258 - rx-fifo-size = <4096>; 259 - tx-fifo-size = <2048>; 260 - rx-fifo-size-gige = <16384>; 261 - tx-fifo-size-gige = <16384>; 262 - phy-mode = "rgmii"; 263 - phy-map = <0x00000000>; 264 - rgmii-device = <&RGMII0>; 265 - rgmii-channel = <1>; 266 - has-inverted-stacr-oc; 267 - has-new-stacr-staopc; 268 - }; 269 - }; 270 - 271 - PCIE0: pcie@a0000000 { 272 - device_type = "pci"; 273 - #interrupt-cells = <1>; 274 - #size-cells = <2>; 275 - #address-cells = <3>; 276 - compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex"; 277 - primary; 278 - port = <0x0>; /* port number */ 279 - reg = <0xa0000000 0x20000000 /* Config space access */ 280 - 0xef000000 0x00001000>; /* Registers */ 281 - dcr-reg = <0x040 0x020>; 282 - sdr-base = <0x400>; 283 - 284 - /* Outbound ranges, one memory and one IO, 285 - * later cannot be changed 286 - */ 287 - ranges = <0x02000000 0x00000000 0x80000000 0x90000000 0x00000000 0x08000000 288 - 0x01000000 0x00000000 0x00000000 0xe0000000 0x00000000 0x00010000>; 289 - 290 - /* Inbound 2GB range starting at 0 */ 291 - dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>; 292 - 293 - /* This drives busses 0x00 to 0x3f */ 294 - bus-range = <0x0 0x3f>; 295 - 296 - /* Legacy interrupts (note the weird polarity, the bridge seems 297 - * to invert PCIe legacy interrupts). 298 - * We are de-swizzling here because the numbers are actually for 299 - * port of the root complex virtual P2P bridge. But I want 300 - * to avoid putting a node for it in the tree, so the numbers 301 - * below are basically de-swizzled numbers. 302 - * The real slot is on idsel 0, so the swizzling is 1:1 303 - */ 304 - interrupt-map-mask = <0x0 0x0 0x0 0x7>; 305 - interrupt-map = < 306 - 0x0 0x0 0x0 0x1 &UIC2 0x0 0x4 /* swizzled int A */ 307 - 0x0 0x0 0x0 0x2 &UIC2 0x1 0x4 /* swizzled int B */ 308 - 0x0 0x0 0x0 0x3 &UIC2 0x2 0x4 /* swizzled int C */ 309 - 0x0 0x0 0x0 0x4 &UIC2 0x3 0x4 /* swizzled int D */>; 310 - }; 311 - 312 - PCIE1: pcie@c0000000 { 313 - device_type = "pci"; 314 - #interrupt-cells = <1>; 315 - #size-cells = <2>; 316 - #address-cells = <3>; 317 - compatible = "ibm,plb-pciex-405ex", "ibm,plb-pciex"; 318 - primary; 319 - port = <0x1>; /* port number */ 320 - reg = <0xc0000000 0x20000000 /* Config space access */ 321 - 0xef001000 0x00001000>; /* Registers */ 322 - dcr-reg = <0x060 0x020>; 323 - sdr-base = <0x440>; 324 - 325 - /* Outbound ranges, one memory and one IO, 326 - * later cannot be changed 327 - */ 328 - ranges = <0x02000000 0x00000000 0x80000000 0x98000000 0x00000000 0x08000000 329 - 0x01000000 0x00000000 0x00000000 0xe0010000 0x00000000 0x00010000>; 330 - 331 - /* Inbound 2GB range starting at 0 */ 332 - dma-ranges = <0x42000000 0x0 0x0 0x0 0x0 0x80000000>; 333 - 334 - /* This drives busses 0x40 to 0x7f */ 335 - bus-range = <0x40 0x7f>; 336 - 337 - /* Legacy interrupts (note the weird polarity, the bridge seems 338 - * to invert PCIe legacy interrupts). 339 - * We are de-swizzling here because the numbers are actually for 340 - * port of the root complex virtual P2P bridge. But I want 341 - * to avoid putting a node for it in the tree, so the numbers 342 - * below are basically de-swizzled numbers. 343 - * The real slot is on idsel 0, so the swizzling is 1:1 344 - */ 345 - interrupt-map-mask = <0x0 0x0 0x0 0x7>; 346 - interrupt-map = < 347 - 0x0 0x0 0x0 0x1 &UIC2 0xb 0x4 /* swizzled int A */ 348 - 0x0 0x0 0x0 0x2 &UIC2 0xc 0x4 /* swizzled int B */ 349 - 0x0 0x0 0x0 0x3 &UIC2 0xd 0x4 /* swizzled int C */ 350 - 0x0 0x0 0x0 0x4 &UIC2 0xe 0x4 /* swizzled int D */>; 351 - }; 352 - }; 353 - };
-314
arch/powerpc/boot/dts/obs600.dts
··· 1 - /* 2 - * Device Tree Source for PlatHome OpenBlockS 600 (405EX) 3 - * 4 - * Copyright 2011 Ben Herrenschmidt, IBM Corp. 5 - * 6 - * Based on Kilauea by: 7 - * 8 - * Copyright 2007-2009 DENX Software Engineering, Stefan Roese <sr@denx.de> 9 - * 10 - * This file is licensed under the terms of the GNU General Public 11 - * License version 2. This program is licensed "as is" without 12 - * any warranty of any kind, whether express or implied. 13 - */ 14 - 15 - /dts-v1/; 16 - 17 - / { 18 - #address-cells = <1>; 19 - #size-cells = <1>; 20 - model = "PlatHome,OpenBlockS 600"; 21 - compatible = "plathome,obs600"; 22 - dcr-parent = <&{/cpus/cpu@0}>; 23 - 24 - aliases { 25 - ethernet0 = &EMAC0; 26 - ethernet1 = &EMAC1; 27 - serial0 = &UART0; 28 - serial1 = &UART1; 29 - }; 30 - 31 - cpus { 32 - #address-cells = <1>; 33 - #size-cells = <0>; 34 - 35 - cpu@0 { 36 - device_type = "cpu"; 37 - model = "PowerPC,405EX"; 38 - reg = <0x00000000>; 39 - clock-frequency = <0>; /* Filled in by U-Boot */ 40 - timebase-frequency = <0>; /* Filled in by U-Boot */ 41 - i-cache-line-size = <32>; 42 - d-cache-line-size = <32>; 43 - i-cache-size = <16384>; /* 16 kB */ 44 - d-cache-size = <16384>; /* 16 kB */ 45 - dcr-controller; 46 - dcr-access-method = "native"; 47 - }; 48 - }; 49 - 50 - memory { 51 - device_type = "memory"; 52 - reg = <0x00000000 0x00000000>; /* Filled in by U-Boot */ 53 - }; 54 - 55 - UIC0: interrupt-controller { 56 - compatible = "ibm,uic-405ex", "ibm,uic"; 57 - interrupt-controller; 58 - cell-index = <0>; 59 - dcr-reg = <0x0c0 0x009>; 60 - #address-cells = <0>; 61 - #size-cells = <0>; 62 - #interrupt-cells = <2>; 63 - }; 64 - 65 - UIC1: interrupt-controller1 { 66 - compatible = "ibm,uic-405ex","ibm,uic"; 67 - interrupt-controller; 68 - cell-index = <1>; 69 - dcr-reg = <0x0d0 0x009>; 70 - #address-cells = <0>; 71 - #size-cells = <0>; 72 - #interrupt-cells = <2>; 73 - interrupts = <0x1e 0x4 0x1f 0x4>; /* cascade */ 74 - interrupt-parent = <&UIC0>; 75 - }; 76 - 77 - UIC2: interrupt-controller2 { 78 - compatible = "ibm,uic-405ex","ibm,uic"; 79 - interrupt-controller; 80 - cell-index = <2>; 81 - dcr-reg = <0x0e0 0x009>; 82 - #address-cells = <0>; 83 - #size-cells = <0>; 84 - #interrupt-cells = <2>; 85 - interrupts = <0x1c 0x4 0x1d 0x4>; /* cascade */ 86 - interrupt-parent = <&UIC0>; 87 - }; 88 - 89 - CPM0: cpm { 90 - compatible = "ibm,cpm"; 91 - dcr-access-method = "native"; 92 - dcr-reg = <0x0b0 0x003>; 93 - unused-units = <0x00000000>; 94 - idle-doze = <0x02000000>; 95 - standby = <0xe3e74800>; 96 - }; 97 - 98 - plb { 99 - compatible = "ibm,plb-405ex", "ibm,plb4"; 100 - #address-cells = <1>; 101 - #size-cells = <1>; 102 - ranges; 103 - clock-frequency = <0>; /* Filled in by U-Boot */ 104 - 105 - SDRAM0: memory-controller { 106 - compatible = "ibm,sdram-405ex", "ibm,sdram-4xx-ddr2"; 107 - dcr-reg = <0x010 0x002>; 108 - interrupt-parent = <&UIC2>; 109 - interrupts = <0x5 0x4 /* ECC DED Error */ 110 - 0x6 0x4>; /* ECC SEC Error */ 111 - }; 112 - 113 - CRYPTO: crypto@ef700000 { 114 - compatible = "amcc,ppc405ex-crypto", "amcc,ppc4xx-crypto"; 115 - reg = <0xef700000 0x80400>; 116 - interrupt-parent = <&UIC0>; 117 - interrupts = <0x17 0x2>; 118 - }; 119 - 120 - MAL0: mcmal { 121 - compatible = "ibm,mcmal-405ex", "ibm,mcmal2"; 122 - dcr-reg = <0x180 0x062>; 123 - num-tx-chans = <2>; 124 - num-rx-chans = <2>; 125 - interrupt-parent = <&MAL0>; 126 - interrupts = <0x0 0x1 0x2 0x3 0x4>; 127 - #interrupt-cells = <1>; 128 - #address-cells = <0>; 129 - #size-cells = <0>; 130 - interrupt-map = </*TXEOB*/ 0x0 &UIC0 0xa 0x4 131 - /*RXEOB*/ 0x1 &UIC0 0xb 0x4 132 - /*SERR*/ 0x2 &UIC1 0x0 0x4 133 - /*TXDE*/ 0x3 &UIC1 0x1 0x4 134 - /*RXDE*/ 0x4 &UIC1 0x2 0x4>; 135 - interrupt-map-mask = <0xffffffff>; 136 - }; 137 - 138 - POB0: opb { 139 - compatible = "ibm,opb-405ex", "ibm,opb"; 140 - #address-cells = <1>; 141 - #size-cells = <1>; 142 - ranges = <0x80000000 0x80000000 0x10000000 143 - 0xef600000 0xef600000 0x00a00000 144 - 0xf0000000 0xf0000000 0x10000000>; 145 - dcr-reg = <0x0a0 0x005>; 146 - clock-frequency = <0>; /* Filled in by U-Boot */ 147 - 148 - EBC0: ebc { 149 - compatible = "ibm,ebc-405ex", "ibm,ebc"; 150 - dcr-reg = <0x012 0x002>; 151 - #address-cells = <2>; 152 - #size-cells = <1>; 153 - clock-frequency = <0>; /* Filled in by U-Boot */ 154 - /* ranges property is supplied by U-Boot */ 155 - interrupts = <0x5 0x1>; 156 - interrupt-parent = <&UIC1>; 157 - 158 - nor_flash@0,0 { 159 - compatible = "amd,s29gl512n", "cfi-flash"; 160 - bank-width = <2>; 161 - reg = <0x00000000 0x00000000 0x08000000>; 162 - #address-cells = <1>; 163 - #size-cells = <1>; 164 - partition@0 { 165 - label = "kernel + initrd"; 166 - reg = <0x00000000 0x03de0000>; 167 - }; 168 - partition@3de0000 { 169 - label = "user config area"; 170 - reg = <0x03de0000 0x00080000>; 171 - }; 172 - partition@3e60000 { 173 - label = "user program area"; 174 - reg = <0x03e60000 0x04000000>; 175 - }; 176 - partition@7e60000 { 177 - label = "flat device tree"; 178 - reg = <0x07e60000 0x00080000>; 179 - }; 180 - partition@7ee0000 { 181 - label = "test program"; 182 - reg = <0x07ee0000 0x00080000>; 183 - }; 184 - partition@7f60000 { 185 - label = "u-boot env"; 186 - reg = <0x07f60000 0x00040000>; 187 - }; 188 - partition@7fa0000 { 189 - label = "u-boot"; 190 - reg = <0x07fa0000 0x00060000>; 191 - }; 192 - }; 193 - }; 194 - 195 - UART0: serial@ef600200 { 196 - device_type = "serial"; 197 - compatible = "ns16550"; 198 - reg = <0xef600200 0x00000008>; 199 - virtual-reg = <0xef600200>; 200 - clock-frequency = <0>; /* Filled in by U-Boot */ 201 - current-speed = <0>; 202 - interrupt-parent = <&UIC0>; 203 - interrupts = <0x1a 0x4>; 204 - }; 205 - 206 - UART1: serial@ef600300 { 207 - device_type = "serial"; 208 - compatible = "ns16550"; 209 - reg = <0xef600300 0x00000008>; 210 - virtual-reg = <0xef600300>; 211 - clock-frequency = <0>; /* Filled in by U-Boot */ 212 - current-speed = <0>; 213 - interrupt-parent = <&UIC0>; 214 - interrupts = <0x1 0x4>; 215 - }; 216 - 217 - IIC0: i2c@ef600400 { 218 - compatible = "ibm,iic-405ex", "ibm,iic"; 219 - reg = <0xef600400 0x00000014>; 220 - interrupt-parent = <&UIC0>; 221 - interrupts = <0x2 0x4>; 222 - #address-cells = <1>; 223 - #size-cells = <0>; 224 - 225 - rtc@68 { 226 - compatible = "dallas,ds1340"; 227 - reg = <0x68>; 228 - }; 229 - }; 230 - 231 - IIC1: i2c@ef600500 { 232 - compatible = "ibm,iic-405ex", "ibm,iic"; 233 - reg = <0xef600500 0x00000014>; 234 - interrupt-parent = <&UIC0>; 235 - interrupts = <0x7 0x4>; 236 - }; 237 - 238 - RGMII0: emac-rgmii@ef600b00 { 239 - compatible = "ibm,rgmii-405ex", "ibm,rgmii"; 240 - reg = <0xef600b00 0x00000104>; 241 - has-mdio; 242 - }; 243 - 244 - EMAC0: ethernet@ef600900 { 245 - linux,network-index = <0x0>; 246 - device_type = "network"; 247 - compatible = "ibm,emac-405ex", "ibm,emac4sync"; 248 - interrupt-parent = <&EMAC0>; 249 - interrupts = <0x0 0x1>; 250 - #interrupt-cells = <1>; 251 - #address-cells = <0>; 252 - #size-cells = <0>; 253 - interrupt-map = </*Status*/ 0x0 &UIC0 0x18 0x4 254 - /*Wake*/ 0x1 &UIC1 0x1d 0x4>; 255 - reg = <0xef600900 0x000000c4>; 256 - local-mac-address = [000000000000]; /* Filled in by U-Boot */ 257 - mal-device = <&MAL0>; 258 - mal-tx-channel = <0>; 259 - mal-rx-channel = <0>; 260 - cell-index = <0>; 261 - max-frame-size = <9000>; 262 - rx-fifo-size = <4096>; 263 - tx-fifo-size = <2048>; 264 - rx-fifo-size-gige = <16384>; 265 - tx-fifo-size-gige = <16384>; 266 - phy-mode = "rgmii"; 267 - phy-map = <0x00000000>; 268 - rgmii-device = <&RGMII0>; 269 - rgmii-channel = <0>; 270 - has-inverted-stacr-oc; 271 - has-new-stacr-staopc; 272 - }; 273 - 274 - EMAC1: ethernet@ef600a00 { 275 - linux,network-index = <0x1>; 276 - device_type = "network"; 277 - compatible = "ibm,emac-405ex", "ibm,emac4sync"; 278 - interrupt-parent = <&EMAC1>; 279 - interrupts = <0x0 0x1>; 280 - #interrupt-cells = <1>; 281 - #address-cells = <0>; 282 - #size-cells = <0>; 283 - interrupt-map = </*Status*/ 0x0 &UIC0 0x19 0x4 284 - /*Wake*/ 0x1 &UIC1 0x1f 0x4>; 285 - reg = <0xef600a00 0x000000c4>; 286 - local-mac-address = [000000000000]; /* Filled in by U-Boot */ 287 - mal-device = <&MAL0>; 288 - mal-tx-channel = <1>; 289 - mal-rx-channel = <1>; 290 - cell-index = <1>; 291 - max-frame-size = <9000>; 292 - rx-fifo-size = <4096>; 293 - tx-fifo-size = <2048>; 294 - rx-fifo-size-gige = <16384>; 295 - tx-fifo-size-gige = <16384>; 296 - phy-mode = "rgmii"; 297 - phy-map = <0x00000000>; 298 - rgmii-device = <&RGMII0>; 299 - rgmii-channel = <1>; 300 - has-inverted-stacr-oc; 301 - has-new-stacr-staopc; 302 - }; 303 - 304 - GPIO: gpio@ef600800 { 305 - device_type = "gpio"; 306 - compatible = "ibm,gpio-405ex", "ibm,ppc4xx-gpio"; 307 - reg = <0xef600800 0x50>; 308 - }; 309 - }; 310 - }; 311 - chosen { 312 - stdout-path = "/plb/opb/serial@ef600200"; 313 - }; 314 - };
-119
arch/powerpc/boot/ppcboot-hotfoot.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * This interface is used for compatibility with old U-boots *ONLY*. 4 - * Please do not imitate or extend this. 5 - */ 6 - 7 - /* 8 - * Unfortunately, the ESTeem Hotfoot board uses a mangled version of 9 - * ppcboot.h for historical reasons, and in the interest of having a 10 - * mainline kernel boot on the production board+bootloader, this was the 11 - * least-offensive solution. Please direct all flames to: 12 - * 13 - * Solomon Peachy <solomon@linux-wlan.com> 14 - * 15 - * (This header is identical to ppcboot.h except for the 16 - * TARGET_HOTFOOT bits) 17 - */ 18 - 19 - /* 20 - * (C) Copyright 2000, 2001 21 - * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 22 - */ 23 - 24 - #ifndef __PPCBOOT_H__ 25 - #define __PPCBOOT_H__ 26 - 27 - /* 28 - * Board information passed to kernel from PPCBoot 29 - * 30 - * include/asm-ppc/ppcboot.h 31 - */ 32 - 33 - #include "types.h" 34 - 35 - typedef struct bd_info { 36 - unsigned long bi_memstart; /* start of DRAM memory */ 37 - unsigned long bi_memsize; /* size of DRAM memory in bytes */ 38 - unsigned long bi_flashstart; /* start of FLASH memory */ 39 - unsigned long bi_flashsize; /* size of FLASH memory */ 40 - unsigned long bi_flashoffset; /* reserved area for startup monitor */ 41 - unsigned long bi_sramstart; /* start of SRAM memory */ 42 - unsigned long bi_sramsize; /* size of SRAM memory */ 43 - #if defined(TARGET_8xx) || defined(TARGET_CPM2) || defined(TARGET_85xx) ||\ 44 - defined(TARGET_83xx) 45 - unsigned long bi_immr_base; /* base of IMMR register */ 46 - #endif 47 - #if defined(TARGET_PPC_MPC52xx) 48 - unsigned long bi_mbar_base; /* base of internal registers */ 49 - #endif 50 - unsigned long bi_bootflags; /* boot / reboot flag (for LynxOS) */ 51 - unsigned long bi_ip_addr; /* IP Address */ 52 - unsigned char bi_enetaddr[6]; /* Ethernet address */ 53 - #if defined(TARGET_HOTFOOT) 54 - /* second onboard ethernet port */ 55 - unsigned char bi_enet1addr[6]; 56 - #define HAVE_ENET1ADDR 57 - #endif /* TARGET_HOOTFOOT */ 58 - unsigned short bi_ethspeed; /* Ethernet speed in Mbps */ 59 - unsigned long bi_intfreq; /* Internal Freq, in MHz */ 60 - unsigned long bi_busfreq; /* Bus Freq, in MHz */ 61 - #if defined(TARGET_CPM2) 62 - unsigned long bi_cpmfreq; /* CPM_CLK Freq, in MHz */ 63 - unsigned long bi_brgfreq; /* BRG_CLK Freq, in MHz */ 64 - unsigned long bi_sccfreq; /* SCC_CLK Freq, in MHz */ 65 - unsigned long bi_vco; /* VCO Out from PLL, in MHz */ 66 - #endif 67 - #if defined(TARGET_PPC_MPC52xx) 68 - unsigned long bi_ipbfreq; /* IPB Bus Freq, in MHz */ 69 - unsigned long bi_pcifreq; /* PCI Bus Freq, in MHz */ 70 - #endif 71 - unsigned long bi_baudrate; /* Console Baudrate */ 72 - #if defined(TARGET_4xx) 73 - unsigned char bi_s_version[4]; /* Version of this structure */ 74 - unsigned char bi_r_version[32]; /* Version of the ROM (IBM) */ 75 - unsigned int bi_procfreq; /* CPU (Internal) Freq, in Hz */ 76 - unsigned int bi_plb_busfreq; /* PLB Bus speed, in Hz */ 77 - unsigned int bi_pci_busfreq; /* PCI Bus speed, in Hz */ 78 - unsigned char bi_pci_enetaddr[6]; /* PCI Ethernet MAC address */ 79 - #endif 80 - #if defined(TARGET_HOTFOOT) 81 - unsigned int bi_pllouta_freq; /* PLL OUTA speed, in Hz */ 82 - #endif 83 - #if defined(TARGET_HYMOD) 84 - hymod_conf_t bi_hymod_conf; /* hymod configuration information */ 85 - #endif 86 - #if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) || \ 87 - defined(TARGET_85xx) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1) 88 - /* second onboard ethernet port */ 89 - unsigned char bi_enet1addr[6]; 90 - #define HAVE_ENET1ADDR 91 - #endif 92 - #if defined(TARGET_EVB64260) || defined(TARGET_440GX) || \ 93 - defined(TARGET_85xx) || defined(TARGET_HAS_ETH2) 94 - /* third onboard ethernet ports */ 95 - unsigned char bi_enet2addr[6]; 96 - #define HAVE_ENET2ADDR 97 - #endif 98 - #if defined(TARGET_440GX) || defined(TARGET_HAS_ETH3) 99 - /* fourth onboard ethernet ports */ 100 - unsigned char bi_enet3addr[6]; 101 - #define HAVE_ENET3ADDR 102 - #endif 103 - #if defined(TARGET_HOTFOOT) 104 - int bi_phynum[2]; /* Determines phy mapping */ 105 - int bi_phymode[2]; /* Determines phy mode */ 106 - #endif 107 - #if defined(TARGET_4xx) 108 - unsigned int bi_opbfreq; /* OB clock in Hz */ 109 - int bi_iic_fast[2]; /* Use fast i2c mode */ 110 - #endif 111 - #if defined(TARGET_440GX) 112 - int bi_phynum[4]; /* phy mapping */ 113 - int bi_phymode[4]; /* phy mode */ 114 - #endif 115 - } bd_t; 116 - 117 - #define bi_tbfreq bi_intfreq 118 - 119 - #endif /* __PPCBOOT_H__ */
+1 -1
arch/powerpc/boot/ppcboot.h
··· 63 63 #if defined(TARGET_HYMOD) 64 64 hymod_conf_t bi_hymod_conf; /* hymod configuration information */ 65 65 #endif 66 - #if defined(TARGET_EVB64260) || defined(TARGET_405EP) || defined(TARGET_44x) || \ 66 + #if defined(TARGET_EVB64260) || defined(TARGET_44x) || \ 67 67 defined(TARGET_85xx) || defined(TARGET_83xx) || defined(TARGET_HAS_ETH1) 68 68 /* second onboard ethernet port */ 69 69 unsigned char bi_enet1addr[6];
+1 -21
arch/powerpc/boot/wrapper
··· 337 337 make_space=n 338 338 pie= 339 339 ;; 340 - ep88xc|ep405|ep8248e) 340 + ep88xc|ep8248e) 341 341 platformo="$object/fixed-head.o $object/$platform.o" 342 342 binary=y 343 343 ;; ··· 463 463 rm -f "$ofile" 464 464 ${MKIMAGE} -A ppc -O linux -T kernel -C $uboot_comp -a $membase -e $membase \ 465 465 $uboot_version -d "$vmz" "$ofile" 466 - if [ -z "$cacheit" ]; then 467 - rm -f "$vmz" 468 - fi 469 - exit 0 470 - ;; 471 - uboot-obs600) 472 - rm -f "$ofile" 473 - # obs600 wants a multi image with an initrd, so we need to put a fake 474 - # one in even when building a "normal" image. 475 - if [ -n "$initrd" ]; then 476 - real_rd="$initrd" 477 - else 478 - real_rd=`mktemp` 479 - echo "\0" >>"$real_rd" 480 - fi 481 - ${MKIMAGE} -A ppc -O linux -T multi -C gzip -a $membase -e $membase \ 482 - $uboot_version -d "$vmz":"$real_rd":"$dtb" "$ofile" 483 - if [ -z "$initrd" ]; then 484 - rm -f "$real_rd" 485 - fi 486 466 if [ -z "$cacheit" ]; then 487 467 rm -f "$vmz" 488 468 fi
-2
arch/powerpc/configs/40x.config
··· 1 - CONFIG_PPC64=n 2 - CONFIG_40x=y
-61
arch/powerpc/configs/40x/acadia_defconfig
··· 1 - CONFIG_40x=y 2 - CONFIG_SYSVIPC=y 3 - CONFIG_POSIX_MQUEUE=y 4 - CONFIG_LOG_BUF_SHIFT=14 5 - CONFIG_BLK_DEV_INITRD=y 6 - CONFIG_EXPERT=y 7 - CONFIG_KALLSYMS_ALL=y 8 - CONFIG_MODULES=y 9 - CONFIG_MODULE_UNLOAD=y 10 - # CONFIG_BLK_DEV_BSG is not set 11 - CONFIG_ACADIA=y 12 - CONFIG_PCI=y 13 - CONFIG_NET=y 14 - CONFIG_PACKET=y 15 - CONFIG_UNIX=y 16 - CONFIG_INET=y 17 - CONFIG_IP_PNP=y 18 - CONFIG_IP_PNP_DHCP=y 19 - CONFIG_IP_PNP_BOOTP=y 20 - # CONFIG_IPV6 is not set 21 - CONFIG_CONNECTOR=y 22 - CONFIG_MTD=y 23 - CONFIG_MTD_CMDLINE_PARTS=y 24 - CONFIG_MTD_BLOCK=m 25 - CONFIG_MTD_CFI=y 26 - CONFIG_MTD_JEDECPROBE=y 27 - CONFIG_MTD_CFI_AMDSTD=y 28 - CONFIG_MTD_PHYSMAP_OF=y 29 - CONFIG_BLK_DEV_RAM=y 30 - CONFIG_BLK_DEV_RAM_SIZE=35000 31 - CONFIG_NETDEVICES=y 32 - CONFIG_IBM_EMAC=y 33 - CONFIG_IBM_EMAC_RXB=256 34 - CONFIG_IBM_EMAC_TXB=256 35 - CONFIG_IBM_EMAC_DEBUG=y 36 - # CONFIG_INPUT is not set 37 - # CONFIG_SERIO is not set 38 - # CONFIG_VT is not set 39 - CONFIG_SERIAL_8250=y 40 - CONFIG_SERIAL_8250_CONSOLE=y 41 - CONFIG_SERIAL_8250_EXTENDED=y 42 - CONFIG_SERIAL_8250_SHARE_IRQ=y 43 - CONFIG_SERIAL_OF_PLATFORM=y 44 - # CONFIG_HW_RANDOM is not set 45 - # CONFIG_HWMON is not set 46 - CONFIG_THERMAL=y 47 - # CONFIG_USB_SUPPORT is not set 48 - CONFIG_EXT2_FS=y 49 - CONFIG_PROC_KCORE=y 50 - CONFIG_TMPFS=y 51 - CONFIG_CRAMFS=y 52 - CONFIG_NFS_FS=y 53 - CONFIG_ROOT_NFS=y 54 - CONFIG_DEBUG_FS=y 55 - CONFIG_MAGIC_SYSRQ=y 56 - CONFIG_DETECT_HUNG_TASK=y 57 - CONFIG_CRYPTO_CBC=y 58 - CONFIG_CRYPTO_ECB=y 59 - CONFIG_CRYPTO_PCBC=y 60 - CONFIG_CRYPTO_MD5=y 61 - CONFIG_CRYPTO_DES=y
-69
arch/powerpc/configs/40x/kilauea_defconfig
··· 1 - CONFIG_40x=y 2 - CONFIG_SYSVIPC=y 3 - CONFIG_POSIX_MQUEUE=y 4 - CONFIG_NO_HZ=y 5 - CONFIG_HIGH_RES_TIMERS=y 6 - CONFIG_LOG_BUF_SHIFT=14 7 - CONFIG_BLK_DEV_INITRD=y 8 - CONFIG_EXPERT=y 9 - CONFIG_KALLSYMS_ALL=y 10 - CONFIG_MODULES=y 11 - CONFIG_MODULE_UNLOAD=y 12 - # CONFIG_BLK_DEV_BSG is not set 13 - CONFIG_KILAUEA=y 14 - CONFIG_PCI=y 15 - CONFIG_NET=y 16 - CONFIG_PACKET=y 17 - CONFIG_UNIX=y 18 - CONFIG_INET=y 19 - CONFIG_IP_PNP=y 20 - CONFIG_IP_PNP_DHCP=y 21 - CONFIG_IP_PNP_BOOTP=y 22 - # CONFIG_IPV6 is not set 23 - CONFIG_CONNECTOR=y 24 - CONFIG_MTD=y 25 - CONFIG_MTD_CMDLINE_PARTS=y 26 - CONFIG_MTD_BLOCK=y 27 - CONFIG_MTD_CFI=y 28 - CONFIG_MTD_JEDECPROBE=y 29 - CONFIG_MTD_CFI_AMDSTD=y 30 - CONFIG_MTD_PHYSMAP_OF=y 31 - CONFIG_MTD_RAW_NAND=y 32 - CONFIG_MTD_NAND_NDFC=y 33 - CONFIG_BLK_DEV_RAM=y 34 - CONFIG_BLK_DEV_RAM_SIZE=35000 35 - CONFIG_NETDEVICES=y 36 - CONFIG_IBM_EMAC=y 37 - CONFIG_IBM_EMAC_RXB=256 38 - CONFIG_IBM_EMAC_TXB=256 39 - # CONFIG_INPUT is not set 40 - # CONFIG_SERIO is not set 41 - # CONFIG_VT is not set 42 - CONFIG_SERIAL_8250=y 43 - CONFIG_SERIAL_8250_CONSOLE=y 44 - CONFIG_SERIAL_8250_EXTENDED=y 45 - CONFIG_SERIAL_8250_SHARE_IRQ=y 46 - CONFIG_SERIAL_OF_PLATFORM=y 47 - # CONFIG_HW_RANDOM is not set 48 - CONFIG_I2C=y 49 - CONFIG_I2C_CHARDEV=y 50 - CONFIG_I2C_IBM_IIC=y 51 - CONFIG_SENSORS_LM75=y 52 - CONFIG_THERMAL=y 53 - # CONFIG_USB_SUPPORT is not set 54 - CONFIG_RTC_CLASS=y 55 - CONFIG_RTC_DRV_DS1307=y 56 - CONFIG_EXT2_FS=y 57 - CONFIG_PROC_KCORE=y 58 - CONFIG_TMPFS=y 59 - CONFIG_CRAMFS=y 60 - CONFIG_NFS_FS=y 61 - CONFIG_ROOT_NFS=y 62 - CONFIG_DEBUG_FS=y 63 - CONFIG_MAGIC_SYSRQ=y 64 - CONFIG_DETECT_HUNG_TASK=y 65 - CONFIG_CRYPTO_CBC=y 66 - CONFIG_CRYPTO_ECB=y 67 - CONFIG_CRYPTO_PCBC=y 68 - CONFIG_CRYPTO_MD5=y 69 - CONFIG_CRYPTO_DES=y
-43
arch/powerpc/configs/40x/klondike_defconfig
··· 1 - CONFIG_40x=y 2 - CONFIG_SYSVIPC=y 3 - CONFIG_LOG_BUF_SHIFT=14 4 - CONFIG_SYSFS_DEPRECATED=y 5 - CONFIG_SYSFS_DEPRECATED_V2=y 6 - CONFIG_BLK_DEV_INITRD=y 7 - CONFIG_EXPERT=y 8 - CONFIG_MODULES=y 9 - CONFIG_MODULE_UNLOAD=y 10 - CONFIG_APM8018X=y 11 - # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set 12 - CONFIG_MATH_EMULATION=y 13 - # CONFIG_SUSPEND is not set 14 - CONFIG_BLK_DEV_RAM=y 15 - CONFIG_BLK_DEV_RAM_SIZE=35000 16 - CONFIG_SCSI=y 17 - CONFIG_BLK_DEV_SD=y 18 - CONFIG_CHR_DEV_SG=y 19 - CONFIG_SCSI_SAS_ATTRS=y 20 - # CONFIG_INPUT is not set 21 - # CONFIG_SERIO is not set 22 - # CONFIG_VT is not set 23 - # CONFIG_UNIX98_PTYS is not set 24 - # CONFIG_LEGACY_PTYS is not set 25 - # CONFIG_HW_RANDOM is not set 26 - # CONFIG_HWMON is not set 27 - # CONFIG_USB_SUPPORT is not set 28 - # CONFIG_IOMMU_SUPPORT is not set 29 - CONFIG_EXT2_FS=y 30 - CONFIG_EXT4_FS=y 31 - CONFIG_MSDOS_FS=y 32 - CONFIG_VFAT_FS=y 33 - CONFIG_PROC_KCORE=y 34 - CONFIG_TMPFS=y 35 - CONFIG_CRAMFS=y 36 - CONFIG_NLS_CODEPAGE_437=y 37 - CONFIG_NLS_ASCII=y 38 - CONFIG_NLS_ISO8859_1=y 39 - CONFIG_NLS_UTF8=y 40 - CONFIG_MAGIC_SYSRQ=y 41 - # CONFIG_SCHED_DEBUG is not set 42 - # CONFIG_DEBUG_BUGVERBOSE is not set 43 - # CONFIG_FTRACE is not set
-59
arch/powerpc/configs/40x/makalu_defconfig
··· 1 - CONFIG_40x=y 2 - CONFIG_SYSVIPC=y 3 - CONFIG_POSIX_MQUEUE=y 4 - CONFIG_LOG_BUF_SHIFT=14 5 - CONFIG_BLK_DEV_INITRD=y 6 - CONFIG_EXPERT=y 7 - CONFIG_KALLSYMS_ALL=y 8 - CONFIG_MODULES=y 9 - CONFIG_MODULE_UNLOAD=y 10 - # CONFIG_BLK_DEV_BSG is not set 11 - CONFIG_MAKALU=y 12 - CONFIG_NET=y 13 - CONFIG_PACKET=y 14 - CONFIG_UNIX=y 15 - CONFIG_INET=y 16 - CONFIG_IP_PNP=y 17 - CONFIG_IP_PNP_DHCP=y 18 - CONFIG_IP_PNP_BOOTP=y 19 - # CONFIG_IPV6 is not set 20 - CONFIG_CONNECTOR=y 21 - CONFIG_MTD=y 22 - CONFIG_MTD_CMDLINE_PARTS=y 23 - CONFIG_MTD_BLOCK=m 24 - CONFIG_MTD_CFI=y 25 - CONFIG_MTD_JEDECPROBE=y 26 - CONFIG_MTD_CFI_AMDSTD=y 27 - CONFIG_MTD_PHYSMAP_OF=y 28 - CONFIG_BLK_DEV_RAM=y 29 - CONFIG_BLK_DEV_RAM_SIZE=35000 30 - CONFIG_NETDEVICES=y 31 - CONFIG_IBM_EMAC=y 32 - CONFIG_IBM_EMAC_RXB=256 33 - CONFIG_IBM_EMAC_TXB=256 34 - # CONFIG_INPUT is not set 35 - # CONFIG_SERIO is not set 36 - # CONFIG_VT is not set 37 - CONFIG_SERIAL_8250=y 38 - CONFIG_SERIAL_8250_CONSOLE=y 39 - CONFIG_SERIAL_8250_EXTENDED=y 40 - CONFIG_SERIAL_8250_SHARE_IRQ=y 41 - CONFIG_SERIAL_OF_PLATFORM=y 42 - # CONFIG_HW_RANDOM is not set 43 - # CONFIG_HWMON is not set 44 - CONFIG_THERMAL=y 45 - # CONFIG_USB_SUPPORT is not set 46 - CONFIG_EXT2_FS=y 47 - CONFIG_PROC_KCORE=y 48 - CONFIG_TMPFS=y 49 - CONFIG_CRAMFS=y 50 - CONFIG_NFS_FS=y 51 - CONFIG_ROOT_NFS=y 52 - CONFIG_DEBUG_FS=y 53 - CONFIG_MAGIC_SYSRQ=y 54 - CONFIG_DETECT_HUNG_TASK=y 55 - CONFIG_CRYPTO_CBC=y 56 - CONFIG_CRYPTO_ECB=y 57 - CONFIG_CRYPTO_PCBC=y 58 - CONFIG_CRYPTO_MD5=y 59 - CONFIG_CRYPTO_DES=y
-69
arch/powerpc/configs/40x/obs600_defconfig
··· 1 - CONFIG_40x=y 2 - CONFIG_SYSVIPC=y 3 - CONFIG_POSIX_MQUEUE=y 4 - CONFIG_NO_HZ=y 5 - CONFIG_HIGH_RES_TIMERS=y 6 - CONFIG_LOG_BUF_SHIFT=14 7 - CONFIG_BLK_DEV_INITRD=y 8 - CONFIG_EXPERT=y 9 - CONFIG_KALLSYMS_ALL=y 10 - CONFIG_MODULES=y 11 - CONFIG_MODULE_UNLOAD=y 12 - # CONFIG_BLK_DEV_BSG is not set 13 - CONFIG_OBS600=y 14 - CONFIG_MATH_EMULATION=y 15 - CONFIG_NET=y 16 - CONFIG_PACKET=y 17 - CONFIG_UNIX=y 18 - CONFIG_INET=y 19 - CONFIG_IP_PNP=y 20 - CONFIG_IP_PNP_DHCP=y 21 - CONFIG_IP_PNP_BOOTP=y 22 - # CONFIG_IPV6 is not set 23 - CONFIG_CONNECTOR=y 24 - CONFIG_MTD=y 25 - CONFIG_MTD_CMDLINE_PARTS=y 26 - CONFIG_MTD_BLOCK=y 27 - CONFIG_MTD_CFI=y 28 - CONFIG_MTD_JEDECPROBE=y 29 - CONFIG_MTD_CFI_AMDSTD=y 30 - CONFIG_MTD_PHYSMAP_OF=y 31 - CONFIG_MTD_RAW_NAND=y 32 - CONFIG_MTD_NAND_NDFC=y 33 - CONFIG_BLK_DEV_RAM=y 34 - CONFIG_BLK_DEV_RAM_SIZE=35000 35 - CONFIG_NETDEVICES=y 36 - CONFIG_IBM_EMAC=y 37 - CONFIG_IBM_EMAC_RXB=256 38 - CONFIG_IBM_EMAC_TXB=256 39 - # CONFIG_INPUT is not set 40 - # CONFIG_SERIO is not set 41 - # CONFIG_VT is not set 42 - CONFIG_SERIAL_8250=y 43 - CONFIG_SERIAL_8250_CONSOLE=y 44 - CONFIG_SERIAL_8250_EXTENDED=y 45 - CONFIG_SERIAL_8250_SHARE_IRQ=y 46 - CONFIG_SERIAL_OF_PLATFORM=y 47 - # CONFIG_HW_RANDOM is not set 48 - CONFIG_I2C=y 49 - CONFIG_I2C_CHARDEV=y 50 - CONFIG_I2C_IBM_IIC=y 51 - CONFIG_SENSORS_LM75=y 52 - CONFIG_THERMAL=y 53 - # CONFIG_USB_SUPPORT is not set 54 - CONFIG_RTC_CLASS=y 55 - CONFIG_RTC_DRV_DS1307=y 56 - CONFIG_EXT2_FS=y 57 - CONFIG_PROC_KCORE=y 58 - CONFIG_TMPFS=y 59 - CONFIG_CRAMFS=y 60 - CONFIG_NFS_FS=y 61 - CONFIG_ROOT_NFS=y 62 - CONFIG_DEBUG_FS=y 63 - CONFIG_MAGIC_SYSRQ=y 64 - CONFIG_DETECT_HUNG_TASK=y 65 - CONFIG_CRYPTO_CBC=y 66 - CONFIG_CRYPTO_ECB=y 67 - CONFIG_CRYPTO_PCBC=y 68 - CONFIG_CRYPTO_MD5=y 69 - CONFIG_CRYPTO_DES=y
-55
arch/powerpc/configs/40x/walnut_defconfig
··· 1 - CONFIG_40x=y 2 - CONFIG_SYSVIPC=y 3 - CONFIG_POSIX_MQUEUE=y 4 - CONFIG_LOG_BUF_SHIFT=14 5 - CONFIG_BLK_DEV_INITRD=y 6 - CONFIG_EXPERT=y 7 - CONFIG_KALLSYMS_ALL=y 8 - CONFIG_MODULES=y 9 - CONFIG_MODULE_UNLOAD=y 10 - # CONFIG_BLK_DEV_BSG is not set 11 - CONFIG_NET=y 12 - CONFIG_PACKET=y 13 - CONFIG_UNIX=y 14 - CONFIG_INET=y 15 - CONFIG_IP_PNP=y 16 - CONFIG_IP_PNP_DHCP=y 17 - CONFIG_IP_PNP_BOOTP=y 18 - # CONFIG_IPV6 is not set 19 - CONFIG_CONNECTOR=y 20 - CONFIG_MTD=y 21 - CONFIG_MTD_CMDLINE_PARTS=y 22 - CONFIG_MTD_BLOCK=m 23 - CONFIG_MTD_CFI=y 24 - CONFIG_MTD_JEDECPROBE=y 25 - CONFIG_MTD_CFI_AMDSTD=y 26 - CONFIG_MTD_PHYSMAP_OF=y 27 - CONFIG_BLK_DEV_RAM=y 28 - CONFIG_BLK_DEV_RAM_SIZE=35000 29 - CONFIG_NETDEVICES=y 30 - CONFIG_IBM_EMAC=y 31 - # CONFIG_INPUT is not set 32 - # CONFIG_SERIO is not set 33 - # CONFIG_VT is not set 34 - CONFIG_SERIAL_8250=y 35 - CONFIG_SERIAL_8250_CONSOLE=y 36 - CONFIG_SERIAL_8250_EXTENDED=y 37 - CONFIG_SERIAL_8250_SHARE_IRQ=y 38 - CONFIG_SERIAL_OF_PLATFORM=y 39 - # CONFIG_HW_RANDOM is not set 40 - # CONFIG_HWMON is not set 41 - CONFIG_THERMAL=y 42 - CONFIG_EXT2_FS=y 43 - CONFIG_PROC_KCORE=y 44 - CONFIG_TMPFS=y 45 - CONFIG_CRAMFS=y 46 - CONFIG_NFS_FS=y 47 - CONFIG_ROOT_NFS=y 48 - CONFIG_DEBUG_FS=y 49 - CONFIG_MAGIC_SYSRQ=y 50 - CONFIG_DETECT_HUNG_TASK=y 51 - CONFIG_CRYPTO_CBC=y 52 - CONFIG_CRYPTO_ECB=y 53 - CONFIG_CRYPTO_PCBC=y 54 - CONFIG_CRYPTO_MD5=y 55 - CONFIG_CRYPTO_DES=y
+2
arch/powerpc/configs/85xx-hw.config
··· 24 24 CONFIG_FSL_CORENET_CF=y 25 25 CONFIG_FSL_DMA=y 26 26 CONFIG_FSL_HV_MANAGER=y 27 + CONFIG_FSL_IFC=y 27 28 CONFIG_FSL_PQ_MDIO=y 28 29 CONFIG_FSL_RIO=y 29 30 CONFIG_FSL_XGMAC_MDIO=y ··· 59 58 CONFIG_MARVELL_PHY=y 60 59 CONFIG_MDIO_BUS_MUX_GPIO=y 61 60 CONFIG_MDIO_BUS_MUX_MMIOREG=y 61 + CONFIG_MEMORY=y 62 62 CONFIG_MMC_SDHCI_OF_ESDHC=y 63 63 CONFIG_MMC_SDHCI_PLTFM=y 64 64 CONFIG_MMC_SDHCI=y
-74
arch/powerpc/configs/ppc40x_defconfig
··· 1 - CONFIG_40x=y 2 - CONFIG_SYSVIPC=y 3 - CONFIG_POSIX_MQUEUE=y 4 - CONFIG_LOG_BUF_SHIFT=14 5 - CONFIG_BLK_DEV_INITRD=y 6 - CONFIG_EXPERT=y 7 - CONFIG_KALLSYMS_ALL=y 8 - CONFIG_MODULES=y 9 - CONFIG_MODULE_UNLOAD=y 10 - # CONFIG_BLK_DEV_BSG is not set 11 - CONFIG_PPC4xx_GPIO=y 12 - CONFIG_ACADIA=y 13 - CONFIG_HOTFOOT=y 14 - CONFIG_KILAUEA=y 15 - CONFIG_MAKALU=y 16 - CONFIG_NET=y 17 - CONFIG_PACKET=y 18 - CONFIG_UNIX=y 19 - CONFIG_INET=y 20 - CONFIG_IP_PNP=y 21 - CONFIG_IP_PNP_DHCP=y 22 - CONFIG_IP_PNP_BOOTP=y 23 - CONFIG_CONNECTOR=y 24 - CONFIG_MTD=y 25 - CONFIG_MTD_CMDLINE_PARTS=y 26 - CONFIG_MTD_BLOCK=m 27 - CONFIG_MTD_CFI=y 28 - CONFIG_MTD_JEDECPROBE=y 29 - CONFIG_MTD_CFI_AMDSTD=y 30 - CONFIG_MTD_PHYSMAP_OF=y 31 - CONFIG_MTD_UBI=m 32 - CONFIG_MTD_UBI_GLUEBI=m 33 - CONFIG_BLK_DEV_RAM=y 34 - CONFIG_BLK_DEV_RAM_SIZE=35000 35 - CONFIG_NETDEVICES=y 36 - CONFIG_IBM_EMAC=y 37 - # CONFIG_INPUT is not set 38 - CONFIG_SERIO=m 39 - # CONFIG_SERIO_I8042 is not set 40 - # CONFIG_SERIO_SERPORT is not set 41 - # CONFIG_VT is not set 42 - CONFIG_SERIAL_8250=y 43 - CONFIG_SERIAL_8250_CONSOLE=y 44 - CONFIG_SERIAL_8250_EXTENDED=y 45 - CONFIG_SERIAL_8250_SHARE_IRQ=y 46 - CONFIG_SERIAL_OF_PLATFORM=y 47 - # CONFIG_HW_RANDOM is not set 48 - CONFIG_I2C=m 49 - CONFIG_I2C_CHARDEV=m 50 - CONFIG_I2C_GPIO=m 51 - CONFIG_I2C_IBM_IIC=m 52 - # CONFIG_HWMON is not set 53 - CONFIG_THERMAL=y 54 - CONFIG_FB=m 55 - CONFIG_EXT2_FS=y 56 - CONFIG_EXT4_FS=m 57 - CONFIG_VFAT_FS=m 58 - CONFIG_PROC_KCORE=y 59 - CONFIG_TMPFS=y 60 - CONFIG_JFFS2_FS=m 61 - CONFIG_UBIFS_FS=m 62 - CONFIG_CRAMFS=y 63 - CONFIG_NFS_FS=y 64 - CONFIG_ROOT_NFS=y 65 - CONFIG_NLS_CODEPAGE_437=m 66 - CONFIG_NLS_ISO8859_1=m 67 - CONFIG_DEBUG_FS=y 68 - CONFIG_MAGIC_SYSRQ=y 69 - CONFIG_DETECT_HUNG_TASK=y 70 - CONFIG_CRYPTO_CBC=y 71 - CONFIG_CRYPTO_ECB=y 72 - CONFIG_CRYPTO_PCBC=y 73 - CONFIG_CRYPTO_MD5=y 74 - CONFIG_CRYPTO_DES=y
-1
arch/powerpc/configs/ppc6xx_defconfig
··· 12 12 CONFIG_TASK_IO_ACCOUNTING=y 13 13 CONFIG_CGROUPS=y 14 14 CONFIG_CGROUP_SCHED=y 15 - CONFIG_RT_GROUP_SCHED=y 16 15 CONFIG_CGROUP_DEVICE=y 17 16 CONFIG_CGROUP_CPUACCT=y 18 17 CONFIG_USER_NS=y
+1 -1
arch/powerpc/include/asm/cacheflush.h
··· 121 121 mb(); /* sync */ 122 122 } 123 123 124 - #ifdef CONFIG_4xx 124 + #ifdef CONFIG_44x 125 125 static inline void flush_instruction_cache(void) 126 126 { 127 127 iccci((void *)KERNELBASE);
+1 -2
arch/powerpc/include/asm/cpu_has_feature.h
··· 24 24 { 25 25 int i; 26 26 27 - #ifndef __clang__ /* clang can't cope with this */ 28 27 BUILD_BUG_ON(!__builtin_constant_p(feature)); 29 - #endif 28 + BUILD_BUG_ON(__builtin_popcountl(feature) > 1); 30 29 31 30 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG 32 31 if (!static_key_feature_checks_initialized) {
-7
arch/powerpc/include/asm/cputable.h
··· 353 353 CPU_FTR_COMMON | CPU_FTR_FPU_UNAVAILABLE | CPU_FTR_NOEXECUTE) 354 354 #define CPU_FTRS_CLASSIC32 (CPU_FTR_COMMON) 355 355 #define CPU_FTRS_8XX (CPU_FTR_NOEXECUTE) 356 - #define CPU_FTRS_40X (CPU_FTR_NOEXECUTE) 357 356 #define CPU_FTRS_44X (CPU_FTR_NOEXECUTE) 358 357 #define CPU_FTRS_440x6 (CPU_FTR_NOEXECUTE | \ 359 358 CPU_FTR_INDEXED_DCR) ··· 506 507 #ifdef CONFIG_PPC_8xx 507 508 CPU_FTRS_8XX | 508 509 #endif 509 - #ifdef CONFIG_40x 510 - CPU_FTRS_40X | 511 - #endif 512 510 #ifdef CONFIG_PPC_47x 513 511 CPU_FTRS_47X | CPU_FTR_476_DD2 | 514 512 #elif defined(CONFIG_44x) ··· 577 581 #endif 578 582 #ifdef CONFIG_PPC_8xx 579 583 CPU_FTRS_8XX & 580 - #endif 581 - #ifdef CONFIG_40x 582 - CPU_FTRS_40X & 583 584 #endif 584 585 #ifdef CONFIG_PPC_47x 585 586 CPU_FTRS_47X &
+2 -1
arch/powerpc/include/asm/guest-state-buffer.h
··· 81 81 #define KVMPPC_GSID_HASHKEYR 0x1050 82 82 #define KVMPPC_GSID_HASHPKEYR 0x1051 83 83 #define KVMPPC_GSID_CTRL 0x1052 84 + #define KVMPPC_GSID_DPDES 0x1053 84 85 85 86 #define KVMPPC_GSID_CR 0x2000 86 87 #define KVMPPC_GSID_PIDR 0x2001 ··· 111 110 #define KVMPPC_GSE_META_COUNT (KVMPPC_GSE_META_END - KVMPPC_GSE_META_START + 1) 112 111 113 112 #define KVMPPC_GSE_DW_REGS_START KVMPPC_GSID_GPR(0) 114 - #define KVMPPC_GSE_DW_REGS_END KVMPPC_GSID_CTRL 113 + #define KVMPPC_GSE_DW_REGS_END KVMPPC_GSID_DPDES 115 114 #define KVMPPC_GSE_DW_REGS_COUNT \ 116 115 (KVMPPC_GSE_DW_REGS_END - KVMPPC_GSE_DW_REGS_START + 1) 117 116
+4 -4
arch/powerpc/include/asm/hw_irq.h
··· 63 63 64 64 static inline void __hard_irq_enable(void) 65 65 { 66 - if (IS_ENABLED(CONFIG_BOOKE_OR_40x)) 66 + if (IS_ENABLED(CONFIG_BOOKE)) 67 67 wrtee(MSR_EE); 68 68 else if (IS_ENABLED(CONFIG_PPC_8xx)) 69 69 wrtspr(SPRN_EIE); ··· 75 75 76 76 static inline void __hard_irq_disable(void) 77 77 { 78 - if (IS_ENABLED(CONFIG_BOOKE_OR_40x)) 78 + if (IS_ENABLED(CONFIG_BOOKE)) 79 79 wrtee(0); 80 80 else if (IS_ENABLED(CONFIG_PPC_8xx)) 81 81 wrtspr(SPRN_EID); ··· 87 87 88 88 static inline void __hard_EE_RI_disable(void) 89 89 { 90 - if (IS_ENABLED(CONFIG_BOOKE_OR_40x)) 90 + if (IS_ENABLED(CONFIG_BOOKE)) 91 91 wrtee(0); 92 92 else if (IS_ENABLED(CONFIG_PPC_8xx)) 93 93 wrtspr(SPRN_NRI); ··· 99 99 100 100 static inline void __hard_RI_enable(void) 101 101 { 102 - if (IS_ENABLED(CONFIG_BOOKE_OR_40x)) 102 + if (IS_ENABLED(CONFIG_BOOKE)) 103 103 return; 104 104 105 105 if (IS_ENABLED(CONFIG_PPC_8xx))
+13 -3
arch/powerpc/include/asm/iommu.h
··· 31 31 #define DIRECT64_PROPNAME "linux,direct64-ddr-window-info" 32 32 #define DMA64_PROPNAME "linux,dma64-ddr-window-info" 33 33 34 + #define MIN_DDW_VPMEM_DMA_WINDOW SZ_2G 35 + 34 36 /* Boot time flags */ 35 37 extern int iommu_is_off; 36 38 extern int iommu_force_on; ··· 158 156 extern struct iommu_table *iommu_init_table(struct iommu_table *tbl, 159 157 int nid, unsigned long res_start, unsigned long res_end); 160 158 bool iommu_table_in_use(struct iommu_table *tbl); 159 + extern void iommu_table_reserve_pages(struct iommu_table *tbl, 160 + unsigned long res_start, unsigned long res_end); 161 + extern void iommu_table_clear(struct iommu_table *tbl); 161 162 162 163 #define IOMMU_TABLE_GROUP_MAX_TABLES 2 163 164 ··· 183 178 long (*unset_window)(struct iommu_table_group *table_group, 184 179 int num); 185 180 /* Switch ownership from platform code to external user (e.g. VFIO) */ 186 - long (*take_ownership)(struct iommu_table_group *table_group); 181 + long (*take_ownership)(struct iommu_table_group *table_group, struct device *dev); 187 182 /* Switch ownership from external user (e.g. VFIO) back to core */ 188 - void (*release_ownership)(struct iommu_table_group *table_group); 183 + void (*release_ownership)(struct iommu_table_group *table_group, struct device *dev); 189 184 }; 190 185 191 186 struct iommu_table_group_link { ··· 222 217 enum dma_data_direction *direction); 223 218 extern void iommu_tce_kill(struct iommu_table *tbl, 224 219 unsigned long entry, unsigned long pages); 220 + int dev_has_iommu_table(struct device *dev, void *data); 225 221 226 - extern struct iommu_table_group_ops spapr_tce_table_group_ops; 227 222 #else 228 223 static inline void iommu_register_group(struct iommu_table_group *table_group, 229 224 int pci_domain_number, ··· 233 228 234 229 static inline int iommu_add_device(struct iommu_table_group *table_group, 235 230 struct device *dev) 231 + { 232 + return 0; 233 + } 234 + 235 + static inline int dev_has_iommu_table(struct device *dev, void *data) 236 236 { 237 237 return 0; 238 238 }
+1 -1
arch/powerpc/include/asm/irq.h
··· 33 33 34 34 struct pt_regs; 35 35 36 - #ifdef CONFIG_BOOKE_OR_40x 36 + #ifdef CONFIG_BOOKE 37 37 /* 38 38 * Per-cpu stacks for handling critical, debug and machine check 39 39 * level interrupts.
+2 -4
arch/powerpc/include/asm/kexec.h
··· 103 103 int setup_purgatory_ppc64(struct kimage *image, const void *slave_code, 104 104 const void *fdt, unsigned long kernel_load_addr, 105 105 unsigned long fdt_load_addr); 106 - unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image); 107 - int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, 108 - unsigned long initrd_load_addr, 109 - unsigned long initrd_len, const char *cmdline); 106 + unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image, struct crash_mem *rmem); 107 + int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, struct crash_mem *rmem); 110 108 #endif /* CONFIG_PPC64 */ 111 109 112 110 #endif /* CONFIG_KEXEC_FILE */
+10 -1
arch/powerpc/include/asm/kfence.h
··· 15 15 #define ARCH_FUNC_PREFIX "." 16 16 #endif 17 17 18 + #ifdef CONFIG_KFENCE 19 + extern bool kfence_disabled; 20 + 21 + static inline void disable_kfence(void) 22 + { 23 + kfence_disabled = true; 24 + } 25 + 18 26 static inline bool arch_kfence_init_pool(void) 19 27 { 20 - return true; 28 + return !kfence_disabled; 21 29 } 30 + #endif 22 31 23 32 #ifdef CONFIG_PPC64 24 33 static inline bool kfence_protect_page(unsigned long addr, bool protect)
+1 -1
arch/powerpc/include/asm/kup.h
··· 20 20 #include <asm/nohash/32/kup-8xx.h> 21 21 #endif 22 22 23 - #ifdef CONFIG_BOOKE_OR_40x 23 + #ifdef CONFIG_BOOKE 24 24 #include <asm/nohash/kup-booke.h> 25 25 #endif 26 26
+1
arch/powerpc/include/asm/kvm_book3s.h
··· 594 594 595 595 596 596 KVMPPC_BOOK3S_VCORE_ACCESSOR(vtb, 64, KVMPPC_GSID_VTB) 597 + KVMPPC_BOOK3S_VCORE_ACCESSOR(dpdes, 64, KVMPPC_GSID_DPDES) 597 598 KVMPPC_BOOK3S_VCORE_ACCESSOR_GET(arch_compat, 32, KVMPPC_GSID_LOGICAL_PVR) 598 599 KVMPPC_BOOK3S_VCORE_ACCESSOR_GET(lpcr, 64, KVMPPC_GSID_LPCR) 599 600 KVMPPC_BOOK3S_VCORE_ACCESSOR_SET(tb_offset, 64, KVMPPC_GSID_TB_OFFSET)
+5
arch/powerpc/include/asm/kvm_book3s_64.h
··· 684 684 int kvmhv_nestedv2_parse_output(struct kvm_vcpu *vcpu); 685 685 int kvmhv_nestedv2_set_vpa(struct kvm_vcpu *vcpu, unsigned long vpa); 686 686 687 + int kmvhv_counters_tracepoint_regfunc(void); 688 + void kmvhv_counters_tracepoint_unregfunc(void); 689 + int kvmhv_get_l2_counters_status(void); 690 + void kvmhv_set_l2_counters_status(int cpu, bool status); 691 + 687 692 #endif /* CONFIG_KVM_BOOK3S_HV_POSSIBLE */ 688 693 689 694 #endif /* __ASM_KVM_BOOK3S_64_H__ */
+3
arch/powerpc/include/asm/kvm_host.h
··· 599 599 ulong dawrx0; 600 600 ulong dawr1; 601 601 ulong dawrx1; 602 + ulong dexcr; 603 + ulong hashkeyr; 604 + ulong hashpkeyr; 602 605 ulong ciabr; 603 606 ulong cfar; 604 607 ulong ppr;
+8 -3
arch/powerpc/include/asm/lppaca.h
··· 62 62 u8 donate_dedicated_cpu; /* Donate dedicated CPU cycles */ 63 63 u8 fpregs_in_use; 64 64 u8 pmcregs_in_use; 65 - u8 reserved8[28]; 65 + u8 l2_counters_enable; /* Enable usage of counters for KVM guest */ 66 + u8 reserved8[27]; 66 67 __be64 wait_state_cycles; /* Wait cycles for this proc */ 67 68 u8 reserved9[28]; 68 69 __be16 slb_count; /* # of SLBs to maintain */ ··· 93 92 /* cacheline 4-5 */ 94 93 95 94 __be32 page_ins; /* CMO Hint - # page ins by OS */ 96 - u8 reserved12[148]; 95 + u8 reserved12[28]; 96 + volatile __be64 l1_to_l2_cs_tb; 97 + volatile __be64 l2_to_l1_cs_tb; 98 + volatile __be64 l2_runtime_tb; 99 + u8 reserved13[96]; 97 100 volatile __be64 dtl_idx; /* Dispatch Trace Log head index */ 98 - u8 reserved13[96]; 101 + u8 reserved14[96]; 99 102 } ____cacheline_aligned; 100 103 101 104 #define lppaca_of(cpu) (*paca_ptrs[cpu]->lppaca_ptr)
+1 -9
arch/powerpc/include/asm/mmu.h
··· 16 16 */ 17 17 #define MMU_FTR_HPTE_TABLE ASM_CONST(0x00000001) 18 18 #define MMU_FTR_TYPE_8xx ASM_CONST(0x00000002) 19 - #define MMU_FTR_TYPE_40x ASM_CONST(0x00000004) 20 19 #define MMU_FTR_TYPE_44x ASM_CONST(0x00000008) 21 20 #define MMU_FTR_TYPE_FSL_E ASM_CONST(0x00000010) 22 21 #define MMU_FTR_TYPE_47x ASM_CONST(0x00000020) ··· 152 153 #ifdef CONFIG_PPC_8xx 153 154 MMU_FTR_TYPE_8xx | 154 155 #endif 155 - #ifdef CONFIG_40x 156 - MMU_FTR_TYPE_40x | 157 - #endif 158 156 #ifdef CONFIG_PPC_47x 159 157 MMU_FTR_TYPE_47x | MMU_FTR_USE_TLBIVAX_BCAST | MMU_FTR_LOCK_BCAST_INVAL | 160 158 #elif defined(CONFIG_44x) ··· 198 202 #ifdef CONFIG_PPC_8xx 199 203 #define MMU_FTRS_ALWAYS MMU_FTR_TYPE_8xx 200 204 #endif 201 - #ifdef CONFIG_40x 202 - #define MMU_FTRS_ALWAYS MMU_FTR_TYPE_40x 203 - #endif 204 205 #ifdef CONFIG_PPC_47x 205 206 #define MMU_FTRS_ALWAYS MMU_FTR_TYPE_47x 206 207 #elif defined(CONFIG_44x) ··· 239 246 { 240 247 int i; 241 248 242 - #ifndef __clang__ /* clang can't cope with this */ 243 249 BUILD_BUG_ON(!__builtin_constant_p(feature)); 244 - #endif 250 + BUILD_BUG_ON(__builtin_popcountl(feature) > 1); 245 251 246 252 #ifdef CONFIG_JUMP_LABEL_FEATURE_CHECK_DEBUG 247 253 if (!static_key_feature_checks_initialized) {
-68
arch/powerpc/include/asm/nohash/32/mmu-40x.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef _ASM_POWERPC_MMU_40X_H_ 3 - #define _ASM_POWERPC_MMU_40X_H_ 4 - 5 - /* 6 - * PPC40x support 7 - */ 8 - 9 - #define PPC40X_TLB_SIZE 64 10 - 11 - /* 12 - * TLB entries are defined by a "high" tag portion and a "low" data 13 - * portion. On all architectures, the data portion is 32-bits. 14 - * 15 - * TLB entries are managed entirely under software control by reading, 16 - * writing, and searchoing using the 4xx-specific tlbre, tlbwr, and tlbsx 17 - * instructions. 18 - */ 19 - 20 - #define TLB_LO 1 21 - #define TLB_HI 0 22 - 23 - #define TLB_DATA TLB_LO 24 - #define TLB_TAG TLB_HI 25 - 26 - /* Tag portion */ 27 - 28 - #define TLB_EPN_MASK 0xFFFFFC00 /* Effective Page Number */ 29 - #define TLB_PAGESZ_MASK 0x00000380 30 - #define TLB_PAGESZ(x) (((x) & 0x7) << 7) 31 - #define PAGESZ_1K 0 32 - #define PAGESZ_4K 1 33 - #define PAGESZ_16K 2 34 - #define PAGESZ_64K 3 35 - #define PAGESZ_256K 4 36 - #define PAGESZ_1M 5 37 - #define PAGESZ_4M 6 38 - #define PAGESZ_16M 7 39 - #define TLB_VALID 0x00000040 /* Entry is valid */ 40 - 41 - /* Data portion */ 42 - 43 - #define TLB_RPN_MASK 0xFFFFFC00 /* Real Page Number */ 44 - #define TLB_PERM_MASK 0x00000300 45 - #define TLB_EX 0x00000200 /* Instruction execution allowed */ 46 - #define TLB_WR 0x00000100 /* Writes permitted */ 47 - #define TLB_ZSEL_MASK 0x000000F0 48 - #define TLB_ZSEL(x) (((x) & 0xF) << 4) 49 - #define TLB_ATTR_MASK 0x0000000F 50 - #define TLB_W 0x00000008 /* Caching is write-through */ 51 - #define TLB_I 0x00000004 /* Caching is inhibited */ 52 - #define TLB_M 0x00000002 /* Memory is coherent */ 53 - #define TLB_G 0x00000001 /* Memory is guarded from prefetch */ 54 - 55 - #ifndef __ASSEMBLY__ 56 - 57 - typedef struct { 58 - unsigned int id; 59 - unsigned int active; 60 - void __user *vdso; 61 - } mm_context_t; 62 - 63 - #endif /* !__ASSEMBLY__ */ 64 - 65 - #define mmu_virtual_psize MMU_PAGE_4K 66 - #define mmu_linear_psize MMU_PAGE_256M 67 - 68 - #endif /* _ASM_POWERPC_MMU_40X_H_ */
+1 -3
arch/powerpc/include/asm/nohash/32/pgtable.h
··· 118 118 * (hardware-defined) PowerPC PTE as closely as possible. 119 119 */ 120 120 121 - #if defined(CONFIG_40x) 122 - #include <asm/nohash/32/pte-40x.h> 123 - #elif defined(CONFIG_44x) 121 + #if defined(CONFIG_44x) 124 122 #include <asm/nohash/32/pte-44x.h> 125 123 #elif defined(CONFIG_PPC_85xx) && defined(CONFIG_PTE_64BIT) 126 124 #include <asm/nohash/pte-e500.h>
-73
arch/powerpc/include/asm/nohash/32/pte-40x.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 2 - #ifndef _ASM_POWERPC_NOHASH_32_PTE_40x_H 3 - #define _ASM_POWERPC_NOHASH_32_PTE_40x_H 4 - #ifdef __KERNEL__ 5 - 6 - /* 7 - * At present, all PowerPC 400-class processors share a similar TLB 8 - * architecture. The instruction and data sides share a unified, 9 - * 64-entry, fully-associative TLB which is maintained totally under 10 - * software control. In addition, the instruction side has a 11 - * hardware-managed, 4-entry, fully-associative TLB which serves as a 12 - * first level to the shared TLB. These two TLBs are known as the UTLB 13 - * and ITLB, respectively (see "mmu.h" for definitions). 14 - * 15 - * There are several potential gotchas here. The 40x hardware TLBLO 16 - * field looks like this: 17 - * 18 - * 0 1 2 3 4 ... 18 19 20 21 22 23 24 25 26 27 28 29 30 31 19 - * RPN..................... 0 0 EX WR ZSEL....... W I M G 20 - * 21 - * Where possible we make the Linux PTE bits match up with this 22 - * 23 - * - bits 20 and 21 must be cleared, because we use 4k pages (40x can 24 - * support down to 1k pages), this is done in the TLBMiss exception 25 - * handler. 26 - * - We use only zones 0 (for kernel pages) and 1 (for user pages) 27 - * of the 16 available. Bit 24-26 of the TLB are cleared in the TLB 28 - * miss handler. Bit 27 is PAGE_USER, thus selecting the correct 29 - * zone. 30 - * - PRESENT *must* be in the bottom two bits because swap PTEs 31 - * use the top 30 bits. Because 40x doesn't support SMP anyway, M is 32 - * irrelevant so we borrow it for PAGE_PRESENT. Bit 30 33 - * is cleared in the TLB miss handler before the TLB entry is loaded. 34 - * - All other bits of the PTE are loaded into TLBLO without 35 - * modification, leaving us only the bits 20, 21, 24, 25, 26, 30 for 36 - * software PTE bits. We actually use bits 21, 24, 25, and 37 - * 30 respectively for the software bits: ACCESSED, DIRTY, RW, and 38 - * PRESENT. 39 - */ 40 - 41 - #define _PAGE_GUARDED 0x001 /* G: page is guarded from prefetch */ 42 - #define _PAGE_PRESENT 0x002 /* software: PTE contains a translation */ 43 - #define _PAGE_NO_CACHE 0x004 /* I: caching is inhibited */ 44 - #define _PAGE_WRITETHRU 0x008 /* W: caching is write-through */ 45 - #define _PAGE_READ 0x010 /* software: read permission */ 46 - #define _PAGE_SPECIAL 0x020 /* software: Special page */ 47 - #define _PAGE_DIRTY 0x080 /* software: dirty page */ 48 - #define _PAGE_WRITE 0x100 /* hardware: WR, anded with dirty in exception */ 49 - #define _PAGE_EXEC 0x200 /* hardware: EX permission */ 50 - #define _PAGE_ACCESSED 0x400 /* software: R: page referenced */ 51 - 52 - /* No page size encoding in the linux PTE */ 53 - #define _PAGE_PSIZE 0 54 - 55 - /* cache related flags non existing on 40x */ 56 - #define _PAGE_COHERENT 0 57 - 58 - #define _PMD_PRESENT 0x400 /* PMD points to page of PTEs */ 59 - #define _PMD_PRESENT_MASK _PMD_PRESENT 60 - #define _PMD_BAD 0x802 61 - #define _PMD_SIZE_4M 0x0c0 62 - #define _PMD_SIZE_16M 0x0e0 63 - #define _PMD_USER 0 64 - 65 - #define _PTE_NONE_MASK 0 66 - 67 - #define _PAGE_BASE_NC (_PAGE_PRESENT | _PAGE_ACCESSED) 68 - #define _PAGE_BASE (_PAGE_BASE_NC) 69 - 70 - #include <asm/pgtable-masks.h> 71 - 72 - #endif /* __KERNEL__ */ 73 - #endif /* _ASM_POWERPC_NOHASH_32_PTE_40x_H */
+1 -4
arch/powerpc/include/asm/nohash/mmu.h
··· 2 2 #ifndef _ASM_POWERPC_NOHASH_MMU_H_ 3 3 #define _ASM_POWERPC_NOHASH_MMU_H_ 4 4 5 - #if defined(CONFIG_40x) 6 - /* 40x-style software loaded TLB */ 7 - #include <asm/nohash/32/mmu-40x.h> 8 - #elif defined(CONFIG_44x) 5 + #if defined(CONFIG_44x) 9 6 /* 44x-style software loaded TLB */ 10 7 #include <asm/nohash/32/mmu-44x.h> 11 8 #elif defined(CONFIG_PPC_E500)
+2 -1
arch/powerpc/include/asm/perf_event_server.h
··· 89 89 #define PPMU_NO_SIAR 0x00000100 /* Do not use SIAR */ 90 90 #define PPMU_ARCH_31 0x00000200 /* Has MMCR3, SIER2 and SIER3 */ 91 91 #define PPMU_P10_DD1 0x00000400 /* Is power10 DD1 processor version */ 92 - #define PPMU_HAS_ATTR_CONFIG1 0x00000800 /* Using config1 attribute */ 92 + #define PPMU_P10 0x00000800 /* For power10 pmu */ 93 + #define PPMU_HAS_ATTR_CONFIG1 0x00001000 /* Using config1 attribute */ 93 94 94 95 /* 95 96 * Values for flags to get_alternatives()
-28
arch/powerpc/include/asm/plpar_wrappers.h
··· 18 18 return plpar_hcall_norets(H_POLL_PENDING); 19 19 } 20 20 21 - static inline u8 get_cede_latency_hint(void) 22 - { 23 - return get_lppaca()->cede_latency_hint; 24 - } 25 - 26 - static inline void set_cede_latency_hint(u8 latency_hint) 27 - { 28 - get_lppaca()->cede_latency_hint = latency_hint; 29 - } 30 - 31 21 static inline long cede_processor(void) 32 22 { 33 23 /* ··· 25 35 * means we must not trace H_CEDE. 26 36 */ 27 37 return plpar_hcall_norets_notrace(H_CEDE); 28 - } 29 - 30 - static inline long extended_cede_processor(unsigned long latency_hint) 31 - { 32 - long rc; 33 - u8 old_latency_hint = get_cede_latency_hint(); 34 - 35 - set_cede_latency_hint(latency_hint); 36 - 37 - rc = cede_processor(); 38 - 39 - /* Ensure that H_CEDE returns with IRQs on */ 40 - if (WARN_ON(IS_ENABLED(CONFIG_PPC_IRQ_SOFT_MASK_DEBUG) && !(mfmsr() & MSR_EE))) 41 - __hard_irq_enable(); 42 - 43 - set_cede_latency_hint(old_latency_hint); 44 - 45 - return rc; 46 38 } 47 39 48 40 static inline long vpa_call(unsigned long flags, unsigned long cpu,
+2
arch/powerpc/include/asm/ppc-opcode.h
··· 471 471 #define PPC_RAW_VCMPEQUB_RC(vrt, vra, vrb) \ 472 472 (0x10000006 | ___PPC_RT(vrt) | ___PPC_RA(vra) | ___PPC_RB(vrb) | __PPC_RC21) 473 473 #define PPC_RAW_LD(r, base, i) (0xe8000000 | ___PPC_RT(r) | ___PPC_RA(base) | IMM_DS(i)) 474 + #define PPC_RAW_LWA(r, base, i) (0xe8000002 | ___PPC_RT(r) | ___PPC_RA(base) | IMM_DS(i)) 474 475 #define PPC_RAW_LWZ(r, base, i) (0x80000000 | ___PPC_RT(r) | ___PPC_RA(base) | IMM_L(i)) 475 476 #define PPC_RAW_LWZX(t, a, b) (0x7c00002e | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b)) 476 477 #define PPC_RAW_STD(r, base, i) (0xf8000000 | ___PPC_RS(r) | ___PPC_RA(base) | IMM_DS(i)) ··· 536 535 #define PPC_RAW_MULI(d, a, i) (0x1c000000 | ___PPC_RT(d) | ___PPC_RA(a) | IMM_L(i)) 537 536 #define PPC_RAW_DIVW(d, a, b) (0x7c0003d6 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b)) 538 537 #define PPC_RAW_DIVWU(d, a, b) (0x7c000396 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b)) 538 + #define PPC_RAW_DIVD(d, a, b) (0x7c0003d2 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b)) 539 539 #define PPC_RAW_DIVDU(d, a, b) (0x7c000392 | ___PPC_RT(d) | ___PPC_RA(a) | ___PPC_RB(b)) 540 540 #define PPC_RAW_DIVDE(t, a, b) (0x7c000352 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b)) 541 541 #define PPC_RAW_DIVDE_DOT(t, a, b) (0x7c000352 | ___PPC_RT(t) | ___PPC_RA(a) | ___PPC_RB(b) | 0x1)
+1 -1
arch/powerpc/include/asm/ppc_asm.h
··· 482 482 * and they must be used. 483 483 */ 484 484 485 - #if !defined(CONFIG_4xx) && !defined(CONFIG_PPC_8xx) 485 + #if !defined(CONFIG_44x) && !defined(CONFIG_PPC_8xx) 486 486 #define tlbia \ 487 487 li r4,1024; \ 488 488 mtctr r4; \
+1 -1
arch/powerpc/include/asm/processor.h
··· 159 159 unsigned long sr0; 160 160 #endif 161 161 #endif /* CONFIG_PPC32 */ 162 - #if defined(CONFIG_BOOKE_OR_40x) && defined(CONFIG_PPC_KUAP) 162 + #if defined(CONFIG_BOOKE) && defined(CONFIG_PPC_KUAP) 163 163 unsigned long pid; /* value written in PID reg. at interrupt exit */ 164 164 #endif 165 165 /* Debug Registers */
+1 -1
arch/powerpc/include/asm/ptrace.h
··· 310 310 311 311 static inline bool cpu_has_msr_ri(void) 312 312 { 313 - return !IS_ENABLED(CONFIG_BOOKE_OR_40x); 313 + return !IS_ENABLED(CONFIG_BOOKE); 314 314 } 315 315 316 316 static inline bool regs_is_unrecoverable(struct pt_regs *regs)
+2 -25
arch/powerpc/include/asm/reg.h
··· 18 18 #include <asm/feature-fixups.h> 19 19 20 20 /* Pickup Book E specific registers. */ 21 - #ifdef CONFIG_BOOKE_OR_40x 21 + #ifdef CONFIG_BOOKE 22 22 #include <asm/reg_booke.h> 23 23 #endif 24 24 ··· 233 233 234 234 /* Special Purpose Registers (SPRNs)*/ 235 235 236 - #ifdef CONFIG_40x 237 - #define SPRN_PID 0x3B1 /* Process ID */ 238 - #else 239 236 #define SPRN_PID 0x030 /* Process ID */ 240 237 #ifdef CONFIG_BOOKE 241 238 #define SPRN_PID0 SPRN_PID/* Process ID Register 0 */ 242 - #endif 243 239 #endif 244 240 245 241 #define SPRN_CTR 0x009 /* Count Register */ ··· 523 527 #define SPRN_TSCR 0x399 /* Thread Switch Control Register */ 524 528 525 529 #define SPRN_DEC 0x016 /* Decrement Register */ 526 - #define SPRN_PIT 0x3DB /* Programmable Interval Timer (40x/BOOKE) */ 530 + #define SPRN_PIT 0x3DB /* Programmable Interval Timer (BOOKE) */ 527 531 528 532 #define SPRN_DER 0x095 /* Debug Enable Register */ 529 533 #define DER_RSTE 0x40000000 /* Reset Interrupt */ ··· 1112 1116 * - SPRG2 indicator that we are in RTAS 1113 1117 * - SPRG4 (603 only) pseudo TLB LRU data 1114 1118 * 1115 - * 32-bit 40x: 1116 - * - SPRG0 scratch for exception vectors 1117 - * - SPRG1 scratch for exception vectors 1118 - * - SPRG2 scratch for exception vectors 1119 - * - SPRG4 scratch for exception vectors (not 403) 1120 - * - SPRG5 scratch for exception vectors (not 403) 1121 - * - SPRG6 scratch for exception vectors (not 403) 1122 - * - SPRG7 scratch for exception vectors (not 403) 1123 - * 1124 1119 * 32-bit 440 and FSL BookE: 1125 1120 * - SPRG0 scratch for exception vectors 1126 1121 * - SPRG1 scratch for exception vectors (*) ··· 1201 1214 #define SPRN_SPRG_SCRATCH1 SPRN_SPRG1 1202 1215 #define SPRN_SPRG_SCRATCH2 SPRN_SPRG2 1203 1216 #define SPRN_SPRG_603_LRU SPRN_SPRG4 1204 - #endif 1205 - 1206 - #ifdef CONFIG_40x 1207 - #define SPRN_SPRG_SCRATCH0 SPRN_SPRG0 1208 - #define SPRN_SPRG_SCRATCH1 SPRN_SPRG1 1209 - #define SPRN_SPRG_SCRATCH2 SPRN_SPRG2 1210 - #define SPRN_SPRG_SCRATCH3 SPRN_SPRG4 1211 - #define SPRN_SPRG_SCRATCH4 SPRN_SPRG5 1212 - #define SPRN_SPRG_SCRATCH5 SPRN_SPRG6 1213 - #define SPRN_SPRG_SCRATCH6 SPRN_SPRG7 1214 1217 #endif 1215 1218 1216 1219 #ifdef CONFIG_BOOKE
+2 -111
arch/powerpc/include/asm/reg_booke.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 2 /* 3 3 * Contains register definitions common to the Book E PowerPC 4 - * specification. Notice that while the IBM-40x series of CPUs 5 - * are not true Book E PowerPCs, they borrowed a number of features 6 - * before Book E was finalized, and are included here as well. Unfortunately, 7 - * they sometimes used different locations than true Book E CPUs did. 4 + * specification. 8 5 * 9 6 * Copyright 2009-2010 Freescale Semiconductor, Inc. 10 7 */ ··· 39 42 #define MSR_KERNEL (MSR_ | MSR_64BIT) 40 43 #define MSR_USER32 (MSR_ | MSR_PR | MSR_EE) 41 44 #define MSR_USER64 (MSR_USER32 | MSR_64BIT) 42 - #elif defined (CONFIG_40x) 43 - #define MSR_KERNEL (MSR_ME|MSR_RI|MSR_IR|MSR_DR|MSR_CE) 44 - #define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE) 45 45 #else 46 46 #define MSR_KERNEL (MSR_ME|MSR_RI|MSR_CE) 47 47 #define MSR_USER (MSR_KERNEL|MSR_PR|MSR_EE) ··· 151 157 #define SPRN_TLB3CFG 0x2B3 /* TLB 3 Config Register */ 152 158 #define SPRN_EPR 0x2BE /* External Proxy Register */ 153 159 #define SPRN_CCR1 0x378 /* Core Configuration Register 1 */ 154 - #define SPRN_ZPR 0x3B0 /* Zone Protection Register (40x) */ 155 160 #define SPRN_MAS7 0x3B0 /* MMU Assist Register 7 */ 156 161 #define SPRN_MMUCR 0x3B2 /* MMU Control Register */ 157 162 #define SPRN_CCR0 0x3B3 /* Core Configuration Register 0 */ ··· 159 166 #define SPRN_SGR 0x3B9 /* Storage Guarded Register */ 160 167 #define SPRN_DCWR 0x3BA /* Data Cache Write-thru Register */ 161 168 #define SPRN_SLER 0x3BB /* Little-endian real mode */ 162 - #define SPRN_SU0R 0x3BC /* "User 0" real mode (40x) */ 163 169 #define SPRN_DCMP 0x3D1 /* Data TLB Compare Register */ 164 170 #define SPRN_ICDBDR 0x3D3 /* Instruction Cache Debug Data Register */ 165 171 #define SPRN_EVPR 0x3D6 /* Exception Vector Prefix Register */ ··· 175 183 #define SPRN_SVR 0x3FF /* System Version Register */ 176 184 177 185 /* 178 - * SPRs which have conflicting definitions on true Book E versus classic, 179 - * or IBM 40x. 186 + * SPRs which have conflicting definitions on true Book E versus classic. 180 187 */ 181 - #ifdef CONFIG_BOOKE 182 188 #define SPRN_CSRR0 0x03A /* Critical Save and Restore Register 0 */ 183 189 #define SPRN_CSRR1 0x03B /* Critical Save and Restore Register 1 */ 184 190 #define SPRN_DEAR 0x03D /* Data Error Address Register */ ··· 191 201 #define SPRN_DAC2 0x13D /* Data Address Compare 2 */ 192 202 #define SPRN_TSR 0x150 /* Timer Status Register */ 193 203 #define SPRN_TCR 0x154 /* Timer Control Register */ 194 - #endif /* Book E */ 195 - #ifdef CONFIG_40x 196 - #define SPRN_DBCR1 0x3BD /* Debug Control Register 1 */ 197 - #define SPRN_ESR 0x3D4 /* Exception Syndrome Register */ 198 - #define SPRN_DEAR 0x3D5 /* Data Error Address Register */ 199 - #define SPRN_TSR 0x3D8 /* Timer Status Register */ 200 - #define SPRN_TCR 0x3DA /* Timer Control Register */ 201 - #define SPRN_SRR2 0x3DE /* Save/Restore Register 2 */ 202 - #define SPRN_SRR3 0x3DF /* Save/Restore Register 3 */ 203 - #define SPRN_DBSR 0x3F0 /* Debug Status Register */ 204 - #define SPRN_DBCR0 0x3F2 /* Debug Control Register 0 */ 205 - #define SPRN_DAC1 0x3F6 /* Data Address Compare 1 */ 206 - #define SPRN_DAC2 0x3F7 /* Data Address Compare 2 */ 207 - #define SPRN_CSRR0 SPRN_SRR2 /* Critical Save and Restore Register 0 */ 208 - #define SPRN_CSRR1 SPRN_SRR3 /* Critical Save and Restore Register 1 */ 209 - #endif 210 204 #define SPRN_HACOP 0x15F /* Hypervisor Available Coprocessor Register */ 211 205 212 206 /* Bit definitions for CCR1. */ ··· 270 296 #endif 271 297 272 298 /* Bit definitions for the DBSR. */ 273 - /* 274 - * DBSR bits which have conflicting definitions on true Book E versus IBM 40x. 275 - */ 276 - #ifdef CONFIG_BOOKE 277 299 #define DBSR_IDE 0x80000000 /* Imprecise Debug Event */ 278 300 #define DBSR_MRR 0x30000000 /* Most Recent Reset */ 279 301 #define DBSR_IC 0x08000000 /* Instruction Completion */ ··· 289 319 #define DBSR_CRET 0x00000020 /* Critical Return Debug Event */ 290 320 #define DBSR_IAC12ATS 0x00000002 /* Instr Address Compare 1/2 Toggle */ 291 321 #define DBSR_IAC34ATS 0x00000001 /* Instr Address Compare 3/4 Toggle */ 292 - #endif 293 - #ifdef CONFIG_40x 294 - #define DBSR_IC 0x80000000 /* Instruction Completion */ 295 - #define DBSR_BT 0x40000000 /* Branch taken */ 296 - #define DBSR_IRPT 0x20000000 /* Exception Debug Event */ 297 - #define DBSR_TIE 0x10000000 /* Trap Instruction debug Event */ 298 - #define DBSR_IAC1 0x04000000 /* Instruction Address Compare 1 Event */ 299 - #define DBSR_IAC2 0x02000000 /* Instruction Address Compare 2 Event */ 300 - #define DBSR_IAC3 0x00080000 /* Instruction Address Compare 3 Event */ 301 - #define DBSR_IAC4 0x00040000 /* Instruction Address Compare 4 Event */ 302 - #define DBSR_DAC1R 0x01000000 /* Data Address Compare 1 Read Event */ 303 - #define DBSR_DAC1W 0x00800000 /* Data Address Compare 1 Write Event */ 304 - #define DBSR_DAC2R 0x00400000 /* Data Address Compare 2 Read Event */ 305 - #define DBSR_DAC2W 0x00200000 /* Data Address Compare 2 Write Event */ 306 - #endif 307 322 308 323 /* Bit definitions related to the ESR. */ 309 324 #define ESR_MCI 0x80000000 /* Machine Check - Instruction */ ··· 310 355 #define ESR_SPV 0x00000080 /* Signal Processing operation */ 311 356 312 357 /* Bit definitions related to the DBCR0. */ 313 - #if defined(CONFIG_40x) 314 - #define DBCR0_EDM 0x80000000 /* External Debug Mode */ 315 - #define DBCR0_IDM 0x40000000 /* Internal Debug Mode */ 316 - #define DBCR0_RST 0x30000000 /* all the bits in the RST field */ 317 - #define DBCR0_RST_SYSTEM 0x30000000 /* System Reset */ 318 - #define DBCR0_RST_CHIP 0x20000000 /* Chip Reset */ 319 - #define DBCR0_RST_CORE 0x10000000 /* Core Reset */ 320 - #define DBCR0_RST_NONE 0x00000000 /* No Reset */ 321 - #define DBCR0_IC 0x08000000 /* Instruction Completion */ 322 - #define DBCR0_ICMP DBCR0_IC 323 - #define DBCR0_BT 0x04000000 /* Branch Taken */ 324 - #define DBCR0_BRT DBCR0_BT 325 - #define DBCR0_EDE 0x02000000 /* Exception Debug Event */ 326 - #define DBCR0_IRPT DBCR0_EDE 327 - #define DBCR0_TDE 0x01000000 /* TRAP Debug Event */ 328 - #define DBCR0_IA1 0x00800000 /* Instr Addr compare 1 enable */ 329 - #define DBCR0_IAC1 DBCR0_IA1 330 - #define DBCR0_IA2 0x00400000 /* Instr Addr compare 2 enable */ 331 - #define DBCR0_IAC2 DBCR0_IA2 332 - #define DBCR0_IA12 0x00200000 /* Instr Addr 1-2 range enable */ 333 - #define DBCR0_IA12X 0x00100000 /* Instr Addr 1-2 range eXclusive */ 334 - #define DBCR0_IA3 0x00080000 /* Instr Addr compare 3 enable */ 335 - #define DBCR0_IAC3 DBCR0_IA3 336 - #define DBCR0_IA4 0x00040000 /* Instr Addr compare 4 enable */ 337 - #define DBCR0_IAC4 DBCR0_IA4 338 - #define DBCR0_IA34 0x00020000 /* Instr Addr 3-4 range Enable */ 339 - #define DBCR0_IA34X 0x00010000 /* Instr Addr 3-4 range eXclusive */ 340 - #define DBCR0_IA12T 0x00008000 /* Instr Addr 1-2 range Toggle */ 341 - #define DBCR0_IA34T 0x00004000 /* Instr Addr 3-4 range Toggle */ 342 - #define DBCR0_FT 0x00000001 /* Freeze Timers on debug event */ 343 - 344 - #define dbcr_iac_range(task) ((task)->thread.debug.dbcr0) 345 - #define DBCR_IAC12I DBCR0_IA12 /* Range Inclusive */ 346 - #define DBCR_IAC12X (DBCR0_IA12 | DBCR0_IA12X) /* Range Exclusive */ 347 - #define DBCR_IAC12MODE (DBCR0_IA12 | DBCR0_IA12X) /* IAC 1-2 Mode Bits */ 348 - #define DBCR_IAC34I DBCR0_IA34 /* Range Inclusive */ 349 - #define DBCR_IAC34X (DBCR0_IA34 | DBCR0_IA34X) /* Range Exclusive */ 350 - #define DBCR_IAC34MODE (DBCR0_IA34 | DBCR0_IA34X) /* IAC 3-4 Mode Bits */ 351 - 352 - /* Bit definitions related to the DBCR1. */ 353 - #define DBCR1_DAC1R 0x80000000 /* DAC1 Read Debug Event */ 354 - #define DBCR1_DAC2R 0x40000000 /* DAC2 Read Debug Event */ 355 - #define DBCR1_DAC1W 0x20000000 /* DAC1 Write Debug Event */ 356 - #define DBCR1_DAC2W 0x10000000 /* DAC2 Write Debug Event */ 357 - 358 - #define dbcr_dac(task) ((task)->thread.debug.dbcr1) 359 - #define DBCR_DAC1R DBCR1_DAC1R 360 - #define DBCR_DAC1W DBCR1_DAC1W 361 - #define DBCR_DAC2R DBCR1_DAC2R 362 - #define DBCR_DAC2W DBCR1_DAC2W 363 - 364 - /* 365 - * Are there any active Debug Events represented in the 366 - * Debug Control Registers? 367 - */ 368 - #define DBCR0_ACTIVE_EVENTS (DBCR0_ICMP | DBCR0_IAC1 | DBCR0_IAC2 | \ 369 - DBCR0_IAC3 | DBCR0_IAC4) 370 - #define DBCR1_ACTIVE_EVENTS (DBCR1_DAC1R | DBCR1_DAC2R | \ 371 - DBCR1_DAC1W | DBCR1_DAC2W) 372 - #define DBCR_ACTIVE_EVENTS(dbcr0, dbcr1) (((dbcr0) & DBCR0_ACTIVE_EVENTS) || \ 373 - ((dbcr1) & DBCR1_ACTIVE_EVENTS)) 374 - 375 - #elif defined(CONFIG_BOOKE) 376 358 #define DBCR0_EDM 0x80000000 /* External Debug Mode */ 377 359 #define DBCR0_IDM 0x40000000 /* Internal Debug Mode */ 378 360 #define DBCR0_RST 0x30000000 /* all the bits in the RST field */ ··· 410 518 411 519 #define DBCR_ACTIVE_EVENTS(dbcr0, dbcr1) (((dbcr0) & DBCR0_ACTIVE_EVENTS) || \ 412 520 ((dbcr1) & DBCR1_ACTIVE_EVENTS)) 413 - #endif /* #elif defined(CONFIG_BOOKE) */ 414 521 415 522 /* Bit definitions related to the TCR. */ 416 523 #define TCR_WP(x) (((x)&0x3)<<30) /* WDT Period */
+1 -6
arch/powerpc/include/asm/time.h
··· 58 58 */ 59 59 static inline u64 get_dec(void) 60 60 { 61 - if (IS_ENABLED(CONFIG_40x)) 62 - return mfspr(SPRN_PIT); 63 - 64 61 return mfspr(SPRN_DEC); 65 62 } 66 63 ··· 68 71 */ 69 72 static inline void set_dec(u64 val) 70 73 { 71 - if (IS_ENABLED(CONFIG_40x)) 72 - mtspr(SPRN_PIT, (u32)val); 73 - else if (IS_ENABLED(CONFIG_BOOKE)) 74 + if (IS_ENABLED(CONFIG_BOOKE)) 74 75 mtspr(SPRN_DEC, val); 75 76 else 76 77 mtspr(SPRN_DEC, val - 1);
-1
arch/powerpc/include/asm/udbg.h
··· 44 44 void __init udbg_init_rtas_console(void); 45 45 void __init udbg_init_btext(void); 46 46 void __init udbg_init_44x_as1(void); 47 - void __init udbg_init_40x_realmode(void); 48 47 void __init udbg_init_cpm(void); 49 48 void __init udbg_init_usbgecko(void); 50 49 void __init udbg_init_memcons(void);
+3
arch/powerpc/include/uapi/asm/kvm.h
··· 645 645 #define KVM_REG_PPC_SIER3 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc3) 646 646 #define KVM_REG_PPC_DAWR1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc4) 647 647 #define KVM_REG_PPC_DAWRX1 (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc5) 648 + #define KVM_REG_PPC_DEXCR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc6) 649 + #define KVM_REG_PPC_HASHKEYR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc7) 650 + #define KVM_REG_PPC_HASHPKEYR (KVM_REG_PPC | KVM_REG_SIZE_U64 | 0xc8) 648 651 649 652 /* Transactional Memory checkpointed state: 650 653 * This is all GPRs, all VSX regs and a subset of SPRs
-1
arch/powerpc/kernel/Makefile
··· 123 123 124 124 obj-$(CONFIG_PPC64) += head_64.o 125 125 obj-$(CONFIG_PPC_BOOK3S_32) += head_book3s_32.o 126 - obj-$(CONFIG_40x) += head_40x.o 127 126 obj-$(CONFIG_44x) += head_44x.o 128 127 obj-$(CONFIG_PPC_8xx) += head_8xx.o 129 128 obj-$(CONFIG_PPC_85xx) += head_85xx.o
+1 -1
arch/powerpc/kernel/asm-offsets.c
··· 54 54 #endif 55 55 56 56 #ifdef CONFIG_PPC32 57 - #ifdef CONFIG_BOOKE_OR_40x 57 + #ifdef CONFIG_BOOKE 58 58 #include "head_booke.h" 59 59 #endif 60 60 #endif
-4
arch/powerpc/kernel/cpu_specs.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 2 3 - #ifdef CONFIG_40x 4 - #include "cpu_specs_40x.h" 5 - #endif 6 - 7 3 #ifdef CONFIG_PPC_47x 8 4 #include "cpu_specs_47x.h" 9 5 #elif defined(CONFIG_44x)
-280
arch/powerpc/kernel/cpu_specs_40x.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (C) 2001 Ben. Herrenschmidt (benh@kernel.crashing.org) 4 - */ 5 - 6 - static struct cpu_spec cpu_specs[] __initdata = { 7 - { /* STB 04xxx */ 8 - .pvr_mask = 0xffff0000, 9 - .pvr_value = 0x41810000, 10 - .cpu_name = "STB04xxx", 11 - .cpu_features = CPU_FTRS_40X, 12 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 13 - PPC_FEATURE_HAS_4xxMAC, 14 - .mmu_features = MMU_FTR_TYPE_40x, 15 - .icache_bsize = 32, 16 - .dcache_bsize = 32, 17 - .machine_check = machine_check_4xx, 18 - .platform = "ppc405", 19 - }, 20 - { /* NP405L */ 21 - .pvr_mask = 0xffff0000, 22 - .pvr_value = 0x41610000, 23 - .cpu_name = "NP405L", 24 - .cpu_features = CPU_FTRS_40X, 25 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 26 - PPC_FEATURE_HAS_4xxMAC, 27 - .mmu_features = MMU_FTR_TYPE_40x, 28 - .icache_bsize = 32, 29 - .dcache_bsize = 32, 30 - .machine_check = machine_check_4xx, 31 - .platform = "ppc405", 32 - }, 33 - { /* NP4GS3 */ 34 - .pvr_mask = 0xffff0000, 35 - .pvr_value = 0x40B10000, 36 - .cpu_name = "NP4GS3", 37 - .cpu_features = CPU_FTRS_40X, 38 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 39 - PPC_FEATURE_HAS_4xxMAC, 40 - .mmu_features = MMU_FTR_TYPE_40x, 41 - .icache_bsize = 32, 42 - .dcache_bsize = 32, 43 - .machine_check = machine_check_4xx, 44 - .platform = "ppc405", 45 - }, 46 - { /* NP405H */ 47 - .pvr_mask = 0xffff0000, 48 - .pvr_value = 0x41410000, 49 - .cpu_name = "NP405H", 50 - .cpu_features = CPU_FTRS_40X, 51 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 52 - PPC_FEATURE_HAS_4xxMAC, 53 - .mmu_features = MMU_FTR_TYPE_40x, 54 - .icache_bsize = 32, 55 - .dcache_bsize = 32, 56 - .machine_check = machine_check_4xx, 57 - .platform = "ppc405", 58 - }, 59 - { /* 405GPr */ 60 - .pvr_mask = 0xffff0000, 61 - .pvr_value = 0x50910000, 62 - .cpu_name = "405GPr", 63 - .cpu_features = CPU_FTRS_40X, 64 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 65 - PPC_FEATURE_HAS_4xxMAC, 66 - .mmu_features = MMU_FTR_TYPE_40x, 67 - .icache_bsize = 32, 68 - .dcache_bsize = 32, 69 - .machine_check = machine_check_4xx, 70 - .platform = "ppc405", 71 - }, 72 - { /* STBx25xx */ 73 - .pvr_mask = 0xffff0000, 74 - .pvr_value = 0x51510000, 75 - .cpu_name = "STBx25xx", 76 - .cpu_features = CPU_FTRS_40X, 77 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 78 - PPC_FEATURE_HAS_4xxMAC, 79 - .mmu_features = MMU_FTR_TYPE_40x, 80 - .icache_bsize = 32, 81 - .dcache_bsize = 32, 82 - .machine_check = machine_check_4xx, 83 - .platform = "ppc405", 84 - }, 85 - { /* 405LP */ 86 - .pvr_mask = 0xffff0000, 87 - .pvr_value = 0x41F10000, 88 - .cpu_name = "405LP", 89 - .cpu_features = CPU_FTRS_40X, 90 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU, 91 - .mmu_features = MMU_FTR_TYPE_40x, 92 - .icache_bsize = 32, 93 - .dcache_bsize = 32, 94 - .machine_check = machine_check_4xx, 95 - .platform = "ppc405", 96 - }, 97 - { /* 405EP */ 98 - .pvr_mask = 0xffff0000, 99 - .pvr_value = 0x51210000, 100 - .cpu_name = "405EP", 101 - .cpu_features = CPU_FTRS_40X, 102 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 103 - PPC_FEATURE_HAS_4xxMAC, 104 - .mmu_features = MMU_FTR_TYPE_40x, 105 - .icache_bsize = 32, 106 - .dcache_bsize = 32, 107 - .machine_check = machine_check_4xx, 108 - .platform = "ppc405", 109 - }, 110 - { /* 405EX Rev. A/B with Security */ 111 - .pvr_mask = 0xffff000f, 112 - .pvr_value = 0x12910007, 113 - .cpu_name = "405EX Rev. A/B", 114 - .cpu_features = CPU_FTRS_40X, 115 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 116 - PPC_FEATURE_HAS_4xxMAC, 117 - .mmu_features = MMU_FTR_TYPE_40x, 118 - .icache_bsize = 32, 119 - .dcache_bsize = 32, 120 - .machine_check = machine_check_4xx, 121 - .platform = "ppc405", 122 - }, 123 - { /* 405EX Rev. C without Security */ 124 - .pvr_mask = 0xffff000f, 125 - .pvr_value = 0x1291000d, 126 - .cpu_name = "405EX Rev. C", 127 - .cpu_features = CPU_FTRS_40X, 128 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 129 - PPC_FEATURE_HAS_4xxMAC, 130 - .mmu_features = MMU_FTR_TYPE_40x, 131 - .icache_bsize = 32, 132 - .dcache_bsize = 32, 133 - .machine_check = machine_check_4xx, 134 - .platform = "ppc405", 135 - }, 136 - { /* 405EX Rev. C with Security */ 137 - .pvr_mask = 0xffff000f, 138 - .pvr_value = 0x1291000f, 139 - .cpu_name = "405EX Rev. C", 140 - .cpu_features = CPU_FTRS_40X, 141 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 142 - PPC_FEATURE_HAS_4xxMAC, 143 - .mmu_features = MMU_FTR_TYPE_40x, 144 - .icache_bsize = 32, 145 - .dcache_bsize = 32, 146 - .machine_check = machine_check_4xx, 147 - .platform = "ppc405", 148 - }, 149 - { /* 405EX Rev. D without Security */ 150 - .pvr_mask = 0xffff000f, 151 - .pvr_value = 0x12910003, 152 - .cpu_name = "405EX Rev. D", 153 - .cpu_features = CPU_FTRS_40X, 154 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 155 - PPC_FEATURE_HAS_4xxMAC, 156 - .mmu_features = MMU_FTR_TYPE_40x, 157 - .icache_bsize = 32, 158 - .dcache_bsize = 32, 159 - .machine_check = machine_check_4xx, 160 - .platform = "ppc405", 161 - }, 162 - { /* 405EX Rev. D with Security */ 163 - .pvr_mask = 0xffff000f, 164 - .pvr_value = 0x12910005, 165 - .cpu_name = "405EX Rev. D", 166 - .cpu_features = CPU_FTRS_40X, 167 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 168 - PPC_FEATURE_HAS_4xxMAC, 169 - .mmu_features = MMU_FTR_TYPE_40x, 170 - .icache_bsize = 32, 171 - .dcache_bsize = 32, 172 - .machine_check = machine_check_4xx, 173 - .platform = "ppc405", 174 - }, 175 - { /* 405EXr Rev. A/B without Security */ 176 - .pvr_mask = 0xffff000f, 177 - .pvr_value = 0x12910001, 178 - .cpu_name = "405EXr Rev. A/B", 179 - .cpu_features = CPU_FTRS_40X, 180 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 181 - PPC_FEATURE_HAS_4xxMAC, 182 - .mmu_features = MMU_FTR_TYPE_40x, 183 - .icache_bsize = 32, 184 - .dcache_bsize = 32, 185 - .machine_check = machine_check_4xx, 186 - .platform = "ppc405", 187 - }, 188 - { /* 405EXr Rev. C without Security */ 189 - .pvr_mask = 0xffff000f, 190 - .pvr_value = 0x12910009, 191 - .cpu_name = "405EXr Rev. C", 192 - .cpu_features = CPU_FTRS_40X, 193 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 194 - PPC_FEATURE_HAS_4xxMAC, 195 - .mmu_features = MMU_FTR_TYPE_40x, 196 - .icache_bsize = 32, 197 - .dcache_bsize = 32, 198 - .machine_check = machine_check_4xx, 199 - .platform = "ppc405", 200 - }, 201 - { /* 405EXr Rev. C with Security */ 202 - .pvr_mask = 0xffff000f, 203 - .pvr_value = 0x1291000b, 204 - .cpu_name = "405EXr Rev. C", 205 - .cpu_features = CPU_FTRS_40X, 206 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 207 - PPC_FEATURE_HAS_4xxMAC, 208 - .mmu_features = MMU_FTR_TYPE_40x, 209 - .icache_bsize = 32, 210 - .dcache_bsize = 32, 211 - .machine_check = machine_check_4xx, 212 - .platform = "ppc405", 213 - }, 214 - { /* 405EXr Rev. D without Security */ 215 - .pvr_mask = 0xffff000f, 216 - .pvr_value = 0x12910000, 217 - .cpu_name = "405EXr Rev. D", 218 - .cpu_features = CPU_FTRS_40X, 219 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 220 - PPC_FEATURE_HAS_4xxMAC, 221 - .mmu_features = MMU_FTR_TYPE_40x, 222 - .icache_bsize = 32, 223 - .dcache_bsize = 32, 224 - .machine_check = machine_check_4xx, 225 - .platform = "ppc405", 226 - }, 227 - { /* 405EXr Rev. D with Security */ 228 - .pvr_mask = 0xffff000f, 229 - .pvr_value = 0x12910002, 230 - .cpu_name = "405EXr Rev. D", 231 - .cpu_features = CPU_FTRS_40X, 232 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 233 - PPC_FEATURE_HAS_4xxMAC, 234 - .mmu_features = MMU_FTR_TYPE_40x, 235 - .icache_bsize = 32, 236 - .dcache_bsize = 32, 237 - .machine_check = machine_check_4xx, 238 - .platform = "ppc405", 239 - }, 240 - { 241 - /* 405EZ */ 242 - .pvr_mask = 0xffff0000, 243 - .pvr_value = 0x41510000, 244 - .cpu_name = "405EZ", 245 - .cpu_features = CPU_FTRS_40X, 246 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 247 - PPC_FEATURE_HAS_4xxMAC, 248 - .mmu_features = MMU_FTR_TYPE_40x, 249 - .icache_bsize = 32, 250 - .dcache_bsize = 32, 251 - .machine_check = machine_check_4xx, 252 - .platform = "ppc405", 253 - }, 254 - { /* APM8018X */ 255 - .pvr_mask = 0xffff0000, 256 - .pvr_value = 0x7ff11432, 257 - .cpu_name = "APM8018X", 258 - .cpu_features = CPU_FTRS_40X, 259 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 260 - PPC_FEATURE_HAS_4xxMAC, 261 - .mmu_features = MMU_FTR_TYPE_40x, 262 - .icache_bsize = 32, 263 - .dcache_bsize = 32, 264 - .machine_check = machine_check_4xx, 265 - .platform = "ppc405", 266 - }, 267 - { /* default match */ 268 - .pvr_mask = 0x00000000, 269 - .pvr_value = 0x00000000, 270 - .cpu_name = "(generic 40x PPC)", 271 - .cpu_features = CPU_FTRS_40X, 272 - .cpu_user_features = PPC_FEATURE_32 | PPC_FEATURE_HAS_MMU | 273 - PPC_FEATURE_HAS_4xxMAC, 274 - .mmu_features = MMU_FTR_TYPE_40x, 275 - .icache_bsize = 32, 276 - .dcache_bsize = 32, 277 - .machine_check = machine_check_4xx, 278 - .platform = "ppc405", 279 - } 280 - };
-16
arch/powerpc/kernel/eeh.c
··· 1273 1273 1274 1274 #ifdef CONFIG_IOMMU_API 1275 1275 1276 - static int dev_has_iommu_table(struct device *dev, void *data) 1277 - { 1278 - struct pci_dev *pdev = to_pci_dev(dev); 1279 - struct pci_dev **ppdev = data; 1280 - 1281 - if (!dev) 1282 - return 0; 1283 - 1284 - if (device_iommu_mapped(dev)) { 1285 - *ppdev = pdev; 1286 - return 1; 1287 - } 1288 - 1289 - return 0; 1290 - } 1291 - 1292 1276 /** 1293 1277 * eeh_iommu_group_to_pe - Convert IOMMU group to EEH PE 1294 1278 * @group: IOMMU group
+3 -45
arch/powerpc/kernel/entry_32.S
··· 108 108 stw r11, 0(r1) 109 109 mflr r12 110 110 stw r12, _LINK(r1) 111 - #ifdef CONFIG_BOOKE_OR_40x 111 + #ifdef CONFIG_BOOKE 112 112 rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */ 113 113 #endif 114 114 lis r12,STACK_FRAME_REGS_MARKER@ha /* exception frame marker */ ··· 158 158 1: REST_GPR(2, r1) 159 159 REST_GPR(1, r1) 160 160 rfi 161 - #ifdef CONFIG_40x 162 - b . /* Prevent prefetch past rfi */ 163 - #endif 164 161 165 162 3: mtcr r5 166 163 lwz r4,_CTR(r1) ··· 211 214 212 215 .globl fast_exception_return 213 216 fast_exception_return: 214 - #if !(defined(CONFIG_4xx) || defined(CONFIG_BOOKE)) 217 + #ifndef CONFIG_BOOKE 215 218 andi. r10,r9,MSR_RI /* check for recoverable interrupt */ 216 219 beq 3f /* if not, we've got problems */ 217 220 #endif ··· 234 237 REST_GPR(12, r11) 235 238 REST_GPR(11, r11) 236 239 rfi 237 - #ifdef CONFIG_40x 238 - b . /* Prevent prefetch past rfi */ 239 - #endif 240 240 _ASM_NOKPROBE_SYMBOL(fast_exception_return) 241 241 242 242 /* aargh, a nonrecoverable interrupt, panic */ ··· 290 296 REST_GPR(0, r1) 291 297 REST_GPR(1, r1) 292 298 rfi 293 - #ifdef CONFIG_40x 294 - b . /* Prevent prefetch past rfi */ 295 - #endif 296 299 297 300 .Lrestore_nvgprs: 298 301 REST_NVGPRS(r1) ··· 337 346 REST_GPR(0, r1) 338 347 REST_GPR(1, r1) 339 348 rfi 340 - #ifdef CONFIG_40x 341 - b . /* Prevent prefetch past rfi */ 342 - #endif 343 349 344 350 1: /* 345 351 * Emulate stack store with update. New r1 value was already calculated ··· 363 375 mfspr r9, SPRN_SPRG_SCRATCH0 364 376 #endif 365 377 rfi 366 - #ifdef CONFIG_40x 367 - b . /* Prevent prefetch past rfi */ 368 - #endif 369 378 _ASM_NOKPROBE_SYMBOL(interrupt_return) 370 379 371 - #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 380 + #ifdef CONFIG_BOOKE 372 381 373 382 /* 374 383 * Returning from a critical interrupt in user mode doesn't need ··· 380 395 * time of the critical interrupt. 381 396 * 382 397 */ 383 - #ifdef CONFIG_40x 384 - #define PPC_40x_TURN_OFF_MSR_DR \ 385 - /* avoid any possible TLB misses here by turning off MSR.DR, we \ 386 - * assume the instructions here are mapped by a pinned TLB entry */ \ 387 - li r10,MSR_IR; \ 388 - mtmsr r10; \ 389 - isync; \ 390 - tophys(r1, r1); 391 - #else 392 - #define PPC_40x_TURN_OFF_MSR_DR 393 - #endif 394 398 395 399 #define RET_FROM_EXC_LEVEL(exc_lvl_srr0, exc_lvl_srr1, exc_lvl_rfi) \ 396 400 REST_NVGPRS(r1); \ ··· 397 423 mtlr r11; \ 398 424 lwz r10,_CCR(r1); \ 399 425 mtcrf 0xff,r10; \ 400 - PPC_40x_TURN_OFF_MSR_DR; \ 401 426 lwz r9,_DEAR(r1); \ 402 427 lwz r10,_ESR(r1); \ 403 428 mtspr SPRN_DEAR,r9; \ ··· 444 471 #define RESTORE_MMU_REGS 445 472 #endif 446 473 447 - #ifdef CONFIG_40x 448 - .globl ret_from_crit_exc 449 - ret_from_crit_exc: 450 - lis r9,crit_srr0@ha; 451 - lwz r9,crit_srr0@l(r9); 452 - lis r10,crit_srr1@ha; 453 - lwz r10,crit_srr1@l(r10); 454 - mtspr SPRN_SRR0,r9; 455 - mtspr SPRN_SRR1,r10; 456 - RET_FROM_EXC_LEVEL(SPRN_CSRR0, SPRN_CSRR1, PPC_RFCI) 457 - _ASM_NOKPROBE_SYMBOL(ret_from_crit_exc) 458 - #endif /* CONFIG_40x */ 459 - 460 - #ifdef CONFIG_BOOKE 461 474 .globl ret_from_crit_exc 462 475 ret_from_crit_exc: 463 476 RESTORE_xSRR(SRR0,SRR1); ··· 468 509 RET_FROM_EXC_LEVEL(SPRN_MCSRR0, SPRN_MCSRR1, PPC_RFMCI) 469 510 _ASM_NOKPROBE_SYMBOL(ret_from_mcheck_exc) 470 511 #endif /* CONFIG_BOOKE */ 471 - #endif /* !(CONFIG_4xx || CONFIG_BOOKE) */
+1 -1
arch/powerpc/kernel/epapr_hcalls.S
··· 21 21 ori r4, r4,_TLF_NAPPING /* so when we take an exception */ 22 22 PPC_STL r4, TI_LOCAL_FLAGS(r2) /* it will return to our caller */ 23 23 24 - #ifdef CONFIG_BOOKE_OR_40x 24 + #ifdef CONFIG_BOOKE 25 25 wrteei 1 26 26 #else 27 27 mfmsr r4
+1 -11
arch/powerpc/kernel/head_32.h
··· 21 21 mtspr SPRN_SPRG_SCRATCH1,r11 22 22 mfspr r10, SPRN_SPRG_THREAD 23 23 .if \handle_dar_dsisr 24 - #ifdef CONFIG_40x 25 - mfspr r11, SPRN_DEAR 26 - #else 27 24 mfspr r11, SPRN_DAR 28 - #endif 29 25 stw r11, DAR(r10) 30 - #ifdef CONFIG_40x 31 - mfspr r11, SPRN_ESR 32 - #else 33 26 mfspr r11, SPRN_DSISR 34 - #endif 35 27 stw r11, DSISR(r10) 36 28 .endif 37 29 mfspr r11, SPRN_SRR0 ··· 88 96 .endif 89 97 lwz r9, SRR1(r12) 90 98 lwz r12, SRR0(r12) 91 - #ifdef CONFIG_40x 92 - rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */ 93 - #elif defined(CONFIG_PPC_8xx) 99 + #ifdef CONFIG_PPC_8xx 94 100 mtspr SPRN_EID, r2 /* Set MSR_RI */ 95 101 #else 96 102 li r10, MSR_KERNEL /* can take exceptions */
-721
arch/powerpc/kernel/head_40x.S
··· 1 - /* SPDX-License-Identifier: GPL-2.0-or-later */ 2 - /* 3 - * Copyright (c) 1995-1996 Gary Thomas <gdt@linuxppc.org> 4 - * Initial PowerPC version. 5 - * Copyright (c) 1996 Cort Dougan <cort@cs.nmt.edu> 6 - * Rewritten for PReP 7 - * Copyright (c) 1996 Paul Mackerras <paulus@cs.anu.edu.au> 8 - * Low-level exception handers, MMU support, and rewrite. 9 - * Copyright (c) 1997 Dan Malek <dmalek@jlc.net> 10 - * PowerPC 8xx modifications. 11 - * Copyright (c) 1998-1999 TiVo, Inc. 12 - * PowerPC 403GCX modifications. 13 - * Copyright (c) 1999 Grant Erickson <grant@lcse.umn.edu> 14 - * PowerPC 403GCX/405GP modifications. 15 - * Copyright 2000 MontaVista Software Inc. 16 - * PPC405 modifications 17 - * PowerPC 403GCX/405GP modifications. 18 - * Author: MontaVista Software, Inc. 19 - * frank_rowand@mvista.com or source@mvista.com 20 - * debbie_chu@mvista.com 21 - * 22 - * Module name: head_4xx.S 23 - * 24 - * Description: 25 - * Kernel execution entry point code. 26 - */ 27 - 28 - #include <linux/init.h> 29 - #include <linux/pgtable.h> 30 - #include <linux/sizes.h> 31 - #include <linux/linkage.h> 32 - 33 - #include <asm/processor.h> 34 - #include <asm/page.h> 35 - #include <asm/mmu.h> 36 - #include <asm/cputable.h> 37 - #include <asm/thread_info.h> 38 - #include <asm/ppc_asm.h> 39 - #include <asm/asm-offsets.h> 40 - #include <asm/ptrace.h> 41 - 42 - #include "head_32.h" 43 - 44 - /* As with the other PowerPC ports, it is expected that when code 45 - * execution begins here, the following registers contain valid, yet 46 - * optional, information: 47 - * 48 - * r3 - Board info structure pointer (DRAM, frequency, MAC address, etc.) 49 - * r4 - Starting address of the init RAM disk 50 - * r5 - Ending address of the init RAM disk 51 - * r6 - Start of kernel command line string (e.g. "mem=96m") 52 - * r7 - End of kernel command line string 53 - * 54 - * This is all going to change RSN when we add bi_recs....... -- Dan 55 - */ 56 - __HEAD 57 - _GLOBAL(_stext); 58 - _GLOBAL(_start); 59 - 60 - mr r31,r3 /* save device tree ptr */ 61 - 62 - /* We have to turn on the MMU right away so we get cache modes 63 - * set correctly. 64 - */ 65 - bl initial_mmu 66 - 67 - /* We now have the lower 16 Meg mapped into TLB entries, and the caches 68 - * ready to work. 69 - */ 70 - turn_on_mmu: 71 - lis r0,MSR_KERNEL@h 72 - ori r0,r0,MSR_KERNEL@l 73 - mtspr SPRN_SRR1,r0 74 - lis r0,start_here@h 75 - ori r0,r0,start_here@l 76 - mtspr SPRN_SRR0,r0 77 - rfi /* enables MMU */ 78 - b . /* prevent prefetch past rfi */ 79 - 80 - /* 81 - * This area is used for temporarily saving registers during the 82 - * critical exception prolog. 83 - */ 84 - . = 0xc0 85 - crit_save: 86 - _GLOBAL(crit_r10) 87 - .space 4 88 - _GLOBAL(crit_r11) 89 - .space 4 90 - _GLOBAL(crit_srr0) 91 - .space 4 92 - _GLOBAL(crit_srr1) 93 - .space 4 94 - _GLOBAL(crit_r1) 95 - .space 4 96 - _GLOBAL(crit_dear) 97 - .space 4 98 - _GLOBAL(crit_esr) 99 - .space 4 100 - 101 - /* 102 - * Exception prolog for critical exceptions. This is a little different 103 - * from the normal exception prolog above since a critical exception 104 - * can potentially occur at any point during normal exception processing. 105 - * Thus we cannot use the same SPRG registers as the normal prolog above. 106 - * Instead we use a couple of words of memory at low physical addresses. 107 - * This is OK since we don't support SMP on these processors. 108 - */ 109 - .macro CRITICAL_EXCEPTION_PROLOG trapno name 110 - stw r10,crit_r10@l(0) /* save two registers to work with */ 111 - stw r11,crit_r11@l(0) 112 - mfspr r10,SPRN_SRR0 113 - mfspr r11,SPRN_SRR1 114 - stw r10,crit_srr0@l(0) 115 - stw r11,crit_srr1@l(0) 116 - mfspr r10,SPRN_DEAR 117 - mfspr r11,SPRN_ESR 118 - stw r10,crit_dear@l(0) 119 - stw r11,crit_esr@l(0) 120 - mfcr r10 /* save CR in r10 for now */ 121 - mfspr r11,SPRN_SRR3 /* check whether user or kernel */ 122 - andi. r11,r11,MSR_PR 123 - lis r11,(critirq_ctx-PAGE_OFFSET)@ha 124 - lwz r11,(critirq_ctx-PAGE_OFFSET)@l(r11) 125 - beq 1f 126 - /* COMING FROM USER MODE */ 127 - mfspr r11,SPRN_SPRG_THREAD /* if from user, start at top of */ 128 - lwz r11,TASK_STACK-THREAD(r11) /* this thread's kernel stack */ 129 - 1: stw r1,crit_r1@l(0) 130 - addi r1,r11,THREAD_SIZE-INT_FRAME_SIZE /* Alloc an excpt frm */ 131 - LOAD_REG_IMMEDIATE(r11, MSR_KERNEL & ~(MSR_ME|MSR_DE|MSR_CE)) /* re-enable MMU */ 132 - mtspr SPRN_SRR1, r11 133 - lis r11, 1f@h 134 - ori r11, r11, 1f@l 135 - mtspr SPRN_SRR0, r11 136 - rfi 137 - 138 - .text 139 - 1: 140 - \name\()_virt: 141 - lwz r11,crit_r1@l(0) 142 - stw r11,GPR1(r1) 143 - stw r11,0(r1) 144 - mr r11,r1 145 - stw r10,_CCR(r11) /* save various registers */ 146 - stw r12,GPR12(r11) 147 - stw r9,GPR9(r11) 148 - mflr r10 149 - stw r10,_LINK(r11) 150 - lis r9,PAGE_OFFSET@ha 151 - lwz r10,crit_r10@l(r9) 152 - lwz r12,crit_r11@l(r9) 153 - stw r10,GPR10(r11) 154 - stw r12,GPR11(r11) 155 - lwz r12,crit_dear@l(r9) 156 - lwz r9,crit_esr@l(r9) 157 - stw r12,_DEAR(r11) /* since they may have had stuff */ 158 - stw r9,_ESR(r11) /* exception was taken */ 159 - mfspr r12,SPRN_SRR2 160 - mfspr r9,SPRN_SRR3 161 - rlwinm r9,r9,0,14,12 /* clear MSR_WE (necessary?) */ 162 - COMMON_EXCEPTION_PROLOG_END \trapno + 2 163 - _ASM_NOKPROBE_SYMBOL(\name\()_virt) 164 - .endm 165 - 166 - /* 167 - * State at this point: 168 - * r9 saved in stack frame, now saved SRR3 & ~MSR_WE 169 - * r10 saved in crit_r10 and in stack frame, trashed 170 - * r11 saved in crit_r11 and in stack frame, 171 - * now phys stack/exception frame pointer 172 - * r12 saved in stack frame, now saved SRR2 173 - * CR saved in stack frame, CR0.EQ = !SRR3.PR 174 - * LR, DEAR, ESR in stack frame 175 - * r1 saved in stack frame, now virt stack/excframe pointer 176 - * r0, r3-r8 saved in stack frame 177 - */ 178 - 179 - /* 180 - * Exception vectors. 181 - */ 182 - #define CRITICAL_EXCEPTION(n, label, hdlr) \ 183 - START_EXCEPTION(n, label); \ 184 - CRITICAL_EXCEPTION_PROLOG n label; \ 185 - prepare_transfer_to_handler; \ 186 - bl hdlr; \ 187 - b ret_from_crit_exc 188 - 189 - /* 190 - * 0x0100 - Critical Interrupt Exception 191 - */ 192 - CRITICAL_EXCEPTION(0x0100, CriticalInterrupt, unknown_exception) 193 - 194 - /* 195 - * 0x0200 - Machine Check Exception 196 - */ 197 - CRITICAL_EXCEPTION(0x0200, MachineCheck, machine_check_exception) 198 - 199 - /* 200 - * 0x0300 - Data Storage Exception 201 - * This happens for just a few reasons. U0 set (but we don't do that), 202 - * or zone protection fault (user violation, write to protected page). 203 - * The other Data TLB exceptions bail out to this point 204 - * if they can't resolve the lightweight TLB fault. 205 - */ 206 - START_EXCEPTION(0x0300, DataStorage) 207 - EXCEPTION_PROLOG 0x300 DataStorage handle_dar_dsisr=1 208 - prepare_transfer_to_handler 209 - bl do_page_fault 210 - b interrupt_return 211 - 212 - /* 213 - * 0x0400 - Instruction Storage Exception 214 - * This is caused by a fetch from non-execute or guarded pages. 215 - */ 216 - START_EXCEPTION(0x0400, InstructionAccess) 217 - EXCEPTION_PROLOG 0x400 InstructionAccess 218 - li r5,0 219 - stw r5, _ESR(r11) /* Zero ESR */ 220 - stw r12, _DEAR(r11) /* SRR0 as DEAR */ 221 - prepare_transfer_to_handler 222 - bl do_page_fault 223 - b interrupt_return 224 - 225 - /* 0x0500 - External Interrupt Exception */ 226 - EXCEPTION(0x0500, HardwareInterrupt, do_IRQ) 227 - 228 - /* 0x0600 - Alignment Exception */ 229 - START_EXCEPTION(0x0600, Alignment) 230 - EXCEPTION_PROLOG 0x600 Alignment handle_dar_dsisr=1 231 - prepare_transfer_to_handler 232 - bl alignment_exception 233 - REST_NVGPRS(r1) 234 - b interrupt_return 235 - 236 - /* 0x0700 - Program Exception */ 237 - START_EXCEPTION(0x0700, ProgramCheck) 238 - EXCEPTION_PROLOG 0x700 ProgramCheck handle_dar_dsisr=1 239 - prepare_transfer_to_handler 240 - bl program_check_exception 241 - REST_NVGPRS(r1) 242 - b interrupt_return 243 - 244 - EXCEPTION(0x0800, Trap_08, unknown_exception) 245 - EXCEPTION(0x0900, Trap_09, unknown_exception) 246 - EXCEPTION(0x0A00, Trap_0A, unknown_exception) 247 - EXCEPTION(0x0B00, Trap_0B, unknown_exception) 248 - 249 - /* 0x0C00 - System Call Exception */ 250 - START_EXCEPTION(0x0C00, SystemCall) 251 - SYSCALL_ENTRY 0xc00 252 - /* Trap_0D is commented out to get more space for system call exception */ 253 - 254 - /* EXCEPTION(0x0D00, Trap_0D, unknown_exception) */ 255 - EXCEPTION(0x0E00, Trap_0E, unknown_exception) 256 - EXCEPTION(0x0F00, Trap_0F, unknown_exception) 257 - 258 - /* 0x1000 - Programmable Interval Timer (PIT) Exception */ 259 - START_EXCEPTION(0x1000, DecrementerTrap) 260 - b Decrementer 261 - 262 - /* 0x1010 - Fixed Interval Timer (FIT) Exception */ 263 - START_EXCEPTION(0x1010, FITExceptionTrap) 264 - b FITException 265 - 266 - /* 0x1020 - Watchdog Timer (WDT) Exception */ 267 - START_EXCEPTION(0x1020, WDTExceptionTrap) 268 - b WDTException 269 - 270 - /* 0x1100 - Data TLB Miss Exception 271 - * As the name implies, translation is not in the MMU, so search the 272 - * page tables and fix it. The only purpose of this function is to 273 - * load TLB entries from the page table if they exist. 274 - */ 275 - START_EXCEPTION(0x1100, DTLBMiss) 276 - mtspr SPRN_SPRG_SCRATCH5, r10 /* Save some working registers */ 277 - mtspr SPRN_SPRG_SCRATCH6, r11 278 - mtspr SPRN_SPRG_SCRATCH3, r12 279 - mtspr SPRN_SPRG_SCRATCH4, r9 280 - mfcr r12 281 - mfspr r9, SPRN_PID 282 - rlwimi r12, r9, 0, 0xff 283 - mfspr r10, SPRN_DEAR /* Get faulting address */ 284 - 285 - /* If we are faulting a kernel address, we have to use the 286 - * kernel page tables. 287 - */ 288 - lis r11, PAGE_OFFSET@h 289 - cmplw r10, r11 290 - blt+ 3f 291 - lis r11, swapper_pg_dir@h 292 - ori r11, r11, swapper_pg_dir@l 293 - li r9, 0 294 - mtspr SPRN_PID, r9 /* TLB will have 0 TID */ 295 - b 4f 296 - 297 - /* Get the PGD for the current thread. 298 - */ 299 - 3: 300 - mfspr r11,SPRN_SPRG_THREAD 301 - lwz r11,PGDIR(r11) 302 - #ifdef CONFIG_PPC_KUAP 303 - rlwinm. r9, r9, 0, 0xff 304 - beq 5f /* Kuap fault */ 305 - #endif 306 - 4: 307 - tophys(r11, r11) 308 - rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */ 309 - lwz r11, 0(r11) /* Get L1 entry */ 310 - andi. r9, r11, _PMD_PRESENT /* Check if it points to a PTE page */ 311 - beq 2f /* Bail if no table */ 312 - 313 - rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */ 314 - lwz r11, 0(r11) /* Get Linux PTE */ 315 - li r9, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_READ 316 - andc. r9, r9, r11 /* Check permission */ 317 - bne 5f 318 - 319 - rlwinm r9, r11, 1, _PAGE_WRITE /* dirty => w */ 320 - and r9, r9, r11 /* hwwrite = dirty & w */ 321 - rlwimi r11, r9, 0, _PAGE_WRITE /* replace w by hwwrite */ 322 - 323 - /* Create TLB tag. This is the faulting address plus a static 324 - * set of bits. These are size, valid, E, U0. 325 - */ 326 - li r9, 0x00c0 327 - rlwimi r10, r9, 0, 20, 31 328 - 329 - b finish_tlb_load 330 - 331 - 2: /* Check for possible large-page pmd entry */ 332 - rlwinm. r9, r11, 2, 22, 24 333 - beq 5f 334 - 335 - /* Create TLB tag. This is the faulting address, plus a static 336 - * set of bits (valid, E, U0) plus the size from the PMD. 337 - */ 338 - ori r9, r9, 0x40 339 - rlwimi r10, r9, 0, 20, 31 340 - 341 - b finish_tlb_load 342 - 343 - 5: 344 - /* The bailout. Restore registers to pre-exception conditions 345 - * and call the heavyweights to help us out. 346 - */ 347 - mtspr SPRN_PID, r12 348 - mtcrf 0x80, r12 349 - mfspr r9, SPRN_SPRG_SCRATCH4 350 - mfspr r12, SPRN_SPRG_SCRATCH3 351 - mfspr r11, SPRN_SPRG_SCRATCH6 352 - mfspr r10, SPRN_SPRG_SCRATCH5 353 - b DataStorage 354 - 355 - /* 0x1200 - Instruction TLB Miss Exception 356 - * Nearly the same as above, except we get our information from different 357 - * registers and bailout to a different point. 358 - */ 359 - START_EXCEPTION(0x1200, ITLBMiss) 360 - mtspr SPRN_SPRG_SCRATCH5, r10 /* Save some working registers */ 361 - mtspr SPRN_SPRG_SCRATCH6, r11 362 - mtspr SPRN_SPRG_SCRATCH3, r12 363 - mtspr SPRN_SPRG_SCRATCH4, r9 364 - mfcr r12 365 - mfspr r9, SPRN_PID 366 - rlwimi r12, r9, 0, 0xff 367 - mfspr r10, SPRN_SRR0 /* Get faulting address */ 368 - 369 - /* If we are faulting a kernel address, we have to use the 370 - * kernel page tables. 371 - */ 372 - lis r11, PAGE_OFFSET@h 373 - cmplw r10, r11 374 - blt+ 3f 375 - lis r11, swapper_pg_dir@h 376 - ori r11, r11, swapper_pg_dir@l 377 - li r9, 0 378 - mtspr SPRN_PID, r9 /* TLB will have 0 TID */ 379 - b 4f 380 - 381 - /* Get the PGD for the current thread. 382 - */ 383 - 3: 384 - mfspr r11,SPRN_SPRG_THREAD 385 - lwz r11,PGDIR(r11) 386 - #ifdef CONFIG_PPC_KUAP 387 - rlwinm. r9, r9, 0, 0xff 388 - beq 5f /* Kuap fault */ 389 - #endif 390 - 4: 391 - tophys(r11, r11) 392 - rlwimi r11, r10, 12, 20, 29 /* Create L1 (pgdir/pmd) address */ 393 - lwz r11, 0(r11) /* Get L1 entry */ 394 - andi. r9, r11, _PMD_PRESENT /* Check if it points to a PTE page */ 395 - beq 2f /* Bail if no table */ 396 - 397 - rlwimi r11, r10, 22, 20, 29 /* Compute PTE address */ 398 - lwz r11, 0(r11) /* Get Linux PTE */ 399 - li r9, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC 400 - andc. r9, r9, r11 /* Check permission */ 401 - bne 5f 402 - 403 - rlwinm r9, r11, 1, _PAGE_WRITE /* dirty => w */ 404 - and r9, r9, r11 /* hwwrite = dirty & w */ 405 - rlwimi r11, r9, 0, _PAGE_WRITE /* replace w by hwwrite */ 406 - 407 - /* Create TLB tag. This is the faulting address plus a static 408 - * set of bits. These are size, valid, E, U0. 409 - */ 410 - li r9, 0x00c0 411 - rlwimi r10, r9, 0, 20, 31 412 - 413 - b finish_tlb_load 414 - 415 - 2: /* Check for possible large-page pmd entry */ 416 - rlwinm. r9, r11, 2, 22, 24 417 - beq 5f 418 - 419 - /* Create TLB tag. This is the faulting address, plus a static 420 - * set of bits (valid, E, U0) plus the size from the PMD. 421 - */ 422 - ori r9, r9, 0x40 423 - rlwimi r10, r9, 0, 20, 31 424 - 425 - b finish_tlb_load 426 - 427 - 5: 428 - /* The bailout. Restore registers to pre-exception conditions 429 - * and call the heavyweights to help us out. 430 - */ 431 - mtspr SPRN_PID, r12 432 - mtcrf 0x80, r12 433 - mfspr r9, SPRN_SPRG_SCRATCH4 434 - mfspr r12, SPRN_SPRG_SCRATCH3 435 - mfspr r11, SPRN_SPRG_SCRATCH6 436 - mfspr r10, SPRN_SPRG_SCRATCH5 437 - b InstructionAccess 438 - 439 - EXCEPTION(0x1300, Trap_13, unknown_exception) 440 - EXCEPTION(0x1400, Trap_14, unknown_exception) 441 - EXCEPTION(0x1500, Trap_15, unknown_exception) 442 - EXCEPTION(0x1600, Trap_16, unknown_exception) 443 - EXCEPTION(0x1700, Trap_17, unknown_exception) 444 - EXCEPTION(0x1800, Trap_18, unknown_exception) 445 - EXCEPTION(0x1900, Trap_19, unknown_exception) 446 - EXCEPTION(0x1A00, Trap_1A, unknown_exception) 447 - EXCEPTION(0x1B00, Trap_1B, unknown_exception) 448 - EXCEPTION(0x1C00, Trap_1C, unknown_exception) 449 - EXCEPTION(0x1D00, Trap_1D, unknown_exception) 450 - EXCEPTION(0x1E00, Trap_1E, unknown_exception) 451 - EXCEPTION(0x1F00, Trap_1F, unknown_exception) 452 - 453 - /* Check for a single step debug exception while in an exception 454 - * handler before state has been saved. This is to catch the case 455 - * where an instruction that we are trying to single step causes 456 - * an exception (eg ITLB/DTLB miss) and thus the first instruction of 457 - * the exception handler generates a single step debug exception. 458 - * 459 - * If we get a debug trap on the first instruction of an exception handler, 460 - * we reset the MSR_DE in the _exception handler's_ MSR (the debug trap is 461 - * a critical exception, so we are using SPRN_CSRR1 to manipulate the MSR). 462 - * The exception handler was handling a non-critical interrupt, so it will 463 - * save (and later restore) the MSR via SPRN_SRR1, which will still have 464 - * the MSR_DE bit set. 465 - */ 466 - /* 0x2000 - Debug Exception */ 467 - START_EXCEPTION(0x2000, DebugTrap) 468 - CRITICAL_EXCEPTION_PROLOG 0x2000 DebugTrap 469 - 470 - /* 471 - * If this is a single step or branch-taken exception in an 472 - * exception entry sequence, it was probably meant to apply to 473 - * the code where the exception occurred (since exception entry 474 - * doesn't turn off DE automatically). We simulate the effect 475 - * of turning off DE on entry to an exception handler by turning 476 - * off DE in the SRR3 value and clearing the debug status. 477 - */ 478 - mfspr r10,SPRN_DBSR /* check single-step/branch taken */ 479 - andis. r10,r10,DBSR_IC@h 480 - beq+ 2f 481 - 482 - andi. r10,r9,MSR_IR|MSR_PR /* check supervisor + MMU off */ 483 - beq 1f /* branch and fix it up */ 484 - 485 - mfspr r10,SPRN_SRR2 /* Faulting instruction address */ 486 - cmplwi r10,0x2100 487 - bgt+ 2f /* address above exception vectors */ 488 - 489 - /* here it looks like we got an inappropriate debug exception. */ 490 - 1: rlwinm r9,r9,0,~MSR_DE /* clear DE in the SRR3 value */ 491 - lis r10,DBSR_IC@h /* clear the IC event */ 492 - mtspr SPRN_DBSR,r10 493 - /* restore state and get out */ 494 - lwz r10,_CCR(r11) 495 - lwz r0,GPR0(r11) 496 - lwz r1,GPR1(r11) 497 - mtcrf 0x80,r10 498 - mtspr SPRN_SRR2,r12 499 - mtspr SPRN_SRR3,r9 500 - lwz r9,GPR9(r11) 501 - lwz r12,GPR12(r11) 502 - lwz r10,crit_r10@l(0) 503 - lwz r11,crit_r11@l(0) 504 - rfci 505 - b . 506 - 507 - /* continue normal handling for a critical exception... */ 508 - 2: mfspr r4,SPRN_DBSR 509 - stw r4,_ESR(r11) /* DebugException takes DBSR in _ESR */ 510 - prepare_transfer_to_handler 511 - bl DebugException 512 - b ret_from_crit_exc 513 - 514 - /* Programmable Interval Timer (PIT) Exception. (from 0x1000) */ 515 - __HEAD 516 - Decrementer: 517 - EXCEPTION_PROLOG 0x1000 Decrementer 518 - lis r0,TSR_PIS@h 519 - mtspr SPRN_TSR,r0 /* Clear the PIT exception */ 520 - prepare_transfer_to_handler 521 - bl timer_interrupt 522 - b interrupt_return 523 - 524 - /* Fixed Interval Timer (FIT) Exception. (from 0x1010) */ 525 - __HEAD 526 - FITException: 527 - EXCEPTION_PROLOG 0x1010 FITException 528 - prepare_transfer_to_handler 529 - bl unknown_exception 530 - b interrupt_return 531 - 532 - /* Watchdog Timer (WDT) Exception. (from 0x1020) */ 533 - __HEAD 534 - WDTException: 535 - CRITICAL_EXCEPTION_PROLOG 0x1020 WDTException 536 - prepare_transfer_to_handler 537 - bl WatchdogException 538 - b ret_from_crit_exc 539 - 540 - /* Other PowerPC processors, namely those derived from the 6xx-series 541 - * have vectors from 0x2100 through 0x2F00 defined, but marked as reserved. 542 - * However, for the 4xx-series processors these are neither defined nor 543 - * reserved. 544 - */ 545 - 546 - __HEAD 547 - /* Damn, I came up one instruction too many to fit into the 548 - * exception space :-). Both the instruction and data TLB 549 - * miss get to this point to load the TLB. 550 - * r10 - TLB_TAG value 551 - * r11 - Linux PTE 552 - * r9 - available to use 553 - * PID - loaded with proper value when we get here 554 - * Upon exit, we reload everything and RFI. 555 - * Actually, it will fit now, but oh well.....a common place 556 - * to load the TLB. 557 - */ 558 - tlb_4xx_index: 559 - .long 0 560 - finish_tlb_load: 561 - /* 562 - * Clear out the software-only bits in the PTE to generate the 563 - * TLB_DATA value. These are the bottom 2 bits of the RPM, the 564 - * 4 bits of the zone field, and M. 565 - */ 566 - li r9, 0x0cf2 567 - andc r11, r11, r9 568 - rlwimi r11, r10, 8, 24, 27 /* Copy 4 upper address bit into zone */ 569 - 570 - /* load the next available TLB index. */ 571 - lwz r9, tlb_4xx_index@l(0) 572 - addi r9, r9, 1 573 - andi. r9, r9, PPC40X_TLB_SIZE - 1 574 - stw r9, tlb_4xx_index@l(0) 575 - 576 - tlbwe r11, r9, TLB_DATA /* Load TLB LO */ 577 - tlbwe r10, r9, TLB_TAG /* Load TLB HI */ 578 - 579 - /* Done...restore registers and get out of here. 580 - */ 581 - mtspr SPRN_PID, r12 582 - mtcrf 0x80, r12 583 - mfspr r9, SPRN_SPRG_SCRATCH4 584 - mfspr r12, SPRN_SPRG_SCRATCH3 585 - mfspr r11, SPRN_SPRG_SCRATCH6 586 - mfspr r10, SPRN_SPRG_SCRATCH5 587 - rfi /* Should sync shadow TLBs */ 588 - b . /* prevent prefetch past rfi */ 589 - 590 - /* This is where the main kernel code starts. 591 - */ 592 - start_here: 593 - 594 - /* ptr to current */ 595 - lis r2,init_task@h 596 - ori r2,r2,init_task@l 597 - 598 - /* ptr to phys current thread */ 599 - tophys(r4,r2) 600 - addi r4,r4,THREAD /* init task's THREAD */ 601 - mtspr SPRN_SPRG_THREAD,r4 602 - 603 - /* stack */ 604 - lis r1,init_thread_union@ha 605 - addi r1,r1,init_thread_union@l 606 - li r0,0 607 - stwu r0,THREAD_SIZE-STACK_FRAME_MIN_SIZE(r1) 608 - 609 - bl early_init /* We have to do this with MMU on */ 610 - 611 - /* 612 - * Decide what sort of machine this is and initialize the MMU. 613 - */ 614 - #ifdef CONFIG_KASAN 615 - bl kasan_early_init 616 - #endif 617 - li r3,0 618 - mr r4,r31 619 - bl machine_init 620 - bl MMU_init 621 - 622 - /* Go back to running unmapped so we can load up new values 623 - * and change to using our exception vectors. 624 - * On the 4xx, all we have to do is invalidate the TLB to clear 625 - * the old 16M byte TLB mappings. 626 - */ 627 - lis r4,2f@h 628 - ori r4,r4,2f@l 629 - tophys(r4,r4) 630 - lis r3,(MSR_KERNEL & ~(MSR_IR|MSR_DR))@h 631 - ori r3,r3,(MSR_KERNEL & ~(MSR_IR|MSR_DR))@l 632 - mtspr SPRN_SRR0,r4 633 - mtspr SPRN_SRR1,r3 634 - rfi 635 - b . /* prevent prefetch past rfi */ 636 - 637 - /* Load up the kernel context */ 638 - 2: 639 - sync /* Flush to memory before changing TLB */ 640 - tlbia 641 - isync /* Flush shadow TLBs */ 642 - 643 - /* set up the PTE pointers for the Abatron bdiGDB. 644 - */ 645 - lis r6, swapper_pg_dir@h 646 - ori r6, r6, swapper_pg_dir@l 647 - lis r5, abatron_pteptrs@h 648 - ori r5, r5, abatron_pteptrs@l 649 - stw r5, 0xf0(0) /* Must match your Abatron config file */ 650 - tophys(r5,r5) 651 - stw r6, 0(r5) 652 - 653 - /* Now turn on the MMU for real! */ 654 - lis r4,MSR_KERNEL@h 655 - ori r4,r4,MSR_KERNEL@l 656 - lis r3,start_kernel@h 657 - ori r3,r3,start_kernel@l 658 - mtspr SPRN_SRR0,r3 659 - mtspr SPRN_SRR1,r4 660 - rfi /* enable MMU and jump to start_kernel */ 661 - b . /* prevent prefetch past rfi */ 662 - 663 - /* Set up the initial MMU state so we can do the first level of 664 - * kernel initialization. This maps the first 32 MBytes of memory 1:1 665 - * virtual to physical and more importantly sets the cache mode. 666 - */ 667 - SYM_FUNC_START_LOCAL(initial_mmu) 668 - tlbia /* Invalidate all TLB entries */ 669 - isync 670 - 671 - /* We should still be executing code at physical address 0x0000xxxx 672 - * at this point. However, start_here is at virtual address 673 - * 0xC000xxxx. So, set up a TLB mapping to cover this once 674 - * translation is enabled. 675 - */ 676 - 677 - lis r3,KERNELBASE@h /* Load the kernel virtual address */ 678 - ori r3,r3,KERNELBASE@l 679 - tophys(r4,r3) /* Load the kernel physical address */ 680 - 681 - iccci r0,r3 /* Invalidate the i-cache before use */ 682 - 683 - /* Load the kernel PID. 684 - */ 685 - li r0,0 686 - mtspr SPRN_PID,r0 687 - sync 688 - 689 - /* Configure and load one entry into TLB slots 63 */ 690 - clrrwi r4,r4,10 /* Mask off the real page number */ 691 - ori r4,r4,(TLB_WR | TLB_EX) /* Set the write and execute bits */ 692 - 693 - clrrwi r3,r3,10 /* Mask off the effective page number */ 694 - ori r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_16M)) 695 - 696 - li r0,63 /* TLB slot 63 */ 697 - 698 - tlbwe r4,r0,TLB_DATA /* Load the data portion of the entry */ 699 - tlbwe r3,r0,TLB_TAG /* Load the tag portion of the entry */ 700 - 701 - li r0,62 /* TLB slot 62 */ 702 - addis r4,r4,SZ_16M@h 703 - addis r3,r3,SZ_16M@h 704 - tlbwe r4,r0,TLB_DATA /* Load the data portion of the entry */ 705 - tlbwe r3,r0,TLB_TAG /* Load the tag portion of the entry */ 706 - 707 - isync 708 - 709 - /* Establish the exception vector base 710 - */ 711 - lis r4,KERNELBASE@h /* EVPR only uses the high 16-bits */ 712 - tophys(r0,r4) /* Use the physical address */ 713 - mtspr SPRN_EVPR,r0 714 - 715 - blr 716 - SYM_FUNC_END(initial_mmu) 717 - 718 - _GLOBAL(abort) 719 - mfspr r13,SPRN_DBCR0 720 - oris r13,r13,DBCR0_RST_SYSTEM@h 721 - mtspr SPRN_DBCR0,r13
+1 -2
arch/powerpc/kernel/head_booke.h
··· 145 145 b transfer_to_syscall /* jump to handler */ 146 146 .endm 147 147 148 - /* To handle the additional exception priority levels on 40x and Book-E 148 + /* To handle the additional exception priority levels on Book-E 149 149 * processors we allocate a stack per additional priority level. 150 150 * 151 - * On 40x critical is the only additional level 152 151 * On 44x/e500 we have critical and machine check 153 152 * 154 153 * Additionally we reserve a SPRG for each priority level so we can free up a
+21 -149
arch/powerpc/kernel/iommu.c
··· 643 643 tbl->it_ops->flush(tbl); 644 644 } 645 645 646 - static void iommu_table_clear(struct iommu_table *tbl) 646 + void iommu_table_clear(struct iommu_table *tbl) 647 647 { 648 648 /* 649 649 * In case of firmware assisted dump system goes through clean ··· 684 684 #endif 685 685 } 686 686 687 - static void iommu_table_reserve_pages(struct iommu_table *tbl, 687 + void iommu_table_reserve_pages(struct iommu_table *tbl, 688 688 unsigned long res_start, unsigned long res_end) 689 689 { 690 690 int i; ··· 988 988 EXPORT_SYMBOL_GPL(iommu_direction_to_tce_perm); 989 989 990 990 #ifdef CONFIG_IOMMU_API 991 + 992 + int dev_has_iommu_table(struct device *dev, void *data) 993 + { 994 + struct pci_dev *pdev = to_pci_dev(dev); 995 + struct pci_dev **ppdev = data; 996 + 997 + if (!dev) 998 + return 0; 999 + 1000 + if (device_iommu_mapped(dev)) { 1001 + *ppdev = pdev; 1002 + return 1; 1003 + } 1004 + 1005 + return 0; 1006 + } 1007 + 991 1008 /* 992 1009 * SPAPR TCE API 993 1010 */ ··· 1119 1102 } 1120 1103 EXPORT_SYMBOL_GPL(iommu_tce_kill); 1121 1104 1122 - #if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) 1123 - static int iommu_take_ownership(struct iommu_table *tbl) 1124 - { 1125 - unsigned long flags, i, sz = (tbl->it_size + 7) >> 3; 1126 - int ret = 0; 1127 - 1128 - /* 1129 - * VFIO does not control TCE entries allocation and the guest 1130 - * can write new TCEs on top of existing ones so iommu_tce_build() 1131 - * must be able to release old pages. This functionality 1132 - * requires exchange() callback defined so if it is not 1133 - * implemented, we disallow taking ownership over the table. 1134 - */ 1135 - if (!tbl->it_ops->xchg_no_kill) 1136 - return -EINVAL; 1137 - 1138 - spin_lock_irqsave(&tbl->large_pool.lock, flags); 1139 - for (i = 0; i < tbl->nr_pools; i++) 1140 - spin_lock_nest_lock(&tbl->pools[i].lock, &tbl->large_pool.lock); 1141 - 1142 - if (iommu_table_in_use(tbl)) { 1143 - pr_err("iommu_tce: it_map is not empty"); 1144 - ret = -EBUSY; 1145 - } else { 1146 - memset(tbl->it_map, 0xff, sz); 1147 - } 1148 - 1149 - for (i = 0; i < tbl->nr_pools; i++) 1150 - spin_unlock(&tbl->pools[i].lock); 1151 - spin_unlock_irqrestore(&tbl->large_pool.lock, flags); 1152 - 1153 - return ret; 1154 - } 1155 - 1156 - static void iommu_release_ownership(struct iommu_table *tbl) 1157 - { 1158 - unsigned long flags, i, sz = (tbl->it_size + 7) >> 3; 1159 - 1160 - spin_lock_irqsave(&tbl->large_pool.lock, flags); 1161 - for (i = 0; i < tbl->nr_pools; i++) 1162 - spin_lock_nest_lock(&tbl->pools[i].lock, &tbl->large_pool.lock); 1163 - 1164 - memset(tbl->it_map, 0, sz); 1165 - 1166 - iommu_table_reserve_pages(tbl, tbl->it_reserved_start, 1167 - tbl->it_reserved_end); 1168 - 1169 - for (i = 0; i < tbl->nr_pools; i++) 1170 - spin_unlock(&tbl->pools[i].lock); 1171 - spin_unlock_irqrestore(&tbl->large_pool.lock, flags); 1172 - } 1173 - #endif 1174 - 1175 1105 int iommu_add_device(struct iommu_table_group *table_group, struct device *dev) 1176 1106 { 1177 1107 /* ··· 1151 1187 1152 1188 #if defined(CONFIG_PPC_PSERIES) || defined(CONFIG_PPC_POWERNV) 1153 1189 /* 1154 - * A simple iommu_table_group_ops which only allows reusing the existing 1155 - * iommu_table. This handles VFIO for POWER7 or the nested KVM. 1156 - * The ops does not allow creating windows and only allows reusing the existing 1157 - * one if it matches table_group->tce32_start/tce32_size/page_shift. 1158 - */ 1159 - static unsigned long spapr_tce_get_table_size(__u32 page_shift, 1160 - __u64 window_size, __u32 levels) 1161 - { 1162 - unsigned long size; 1163 - 1164 - if (levels > 1) 1165 - return ~0U; 1166 - size = window_size >> (page_shift - 3); 1167 - return size; 1168 - } 1169 - 1170 - static long spapr_tce_create_table(struct iommu_table_group *table_group, int num, 1171 - __u32 page_shift, __u64 window_size, __u32 levels, 1172 - struct iommu_table **ptbl) 1173 - { 1174 - struct iommu_table *tbl = table_group->tables[0]; 1175 - 1176 - if (num > 0) 1177 - return -EPERM; 1178 - 1179 - if (tbl->it_page_shift != page_shift || 1180 - tbl->it_size != (window_size >> page_shift) || 1181 - tbl->it_indirect_levels != levels - 1) 1182 - return -EINVAL; 1183 - 1184 - *ptbl = iommu_tce_table_get(tbl); 1185 - return 0; 1186 - } 1187 - 1188 - static long spapr_tce_set_window(struct iommu_table_group *table_group, 1189 - int num, struct iommu_table *tbl) 1190 - { 1191 - return tbl == table_group->tables[num] ? 0 : -EPERM; 1192 - } 1193 - 1194 - static long spapr_tce_unset_window(struct iommu_table_group *table_group, int num) 1195 - { 1196 - return 0; 1197 - } 1198 - 1199 - static long spapr_tce_take_ownership(struct iommu_table_group *table_group) 1200 - { 1201 - int i, j, rc = 0; 1202 - 1203 - for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i) { 1204 - struct iommu_table *tbl = table_group->tables[i]; 1205 - 1206 - if (!tbl || !tbl->it_map) 1207 - continue; 1208 - 1209 - rc = iommu_take_ownership(tbl); 1210 - if (!rc) 1211 - continue; 1212 - 1213 - for (j = 0; j < i; ++j) 1214 - iommu_release_ownership(table_group->tables[j]); 1215 - return rc; 1216 - } 1217 - return 0; 1218 - } 1219 - 1220 - static void spapr_tce_release_ownership(struct iommu_table_group *table_group) 1221 - { 1222 - int i; 1223 - 1224 - for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i) { 1225 - struct iommu_table *tbl = table_group->tables[i]; 1226 - 1227 - if (!tbl) 1228 - continue; 1229 - 1230 - iommu_table_clear(tbl); 1231 - if (tbl->it_map) 1232 - iommu_release_ownership(tbl); 1233 - } 1234 - } 1235 - 1236 - struct iommu_table_group_ops spapr_tce_table_group_ops = { 1237 - .get_table_size = spapr_tce_get_table_size, 1238 - .create_table = spapr_tce_create_table, 1239 - .set_window = spapr_tce_set_window, 1240 - .unset_window = spapr_tce_unset_window, 1241 - .take_ownership = spapr_tce_take_ownership, 1242 - .release_ownership = spapr_tce_release_ownership, 1243 - }; 1244 - 1245 - /* 1246 1190 * A simple iommu_ops to allow less cruft in generic VFIO code. 1247 1191 */ 1248 1192 static int ··· 1171 1299 * The domain being set to PLATFORM from earlier 1172 1300 * BLOCKED. The table_group ownership has to be released. 1173 1301 */ 1174 - table_group->ops->release_ownership(table_group); 1302 + table_group->ops->release_ownership(table_group, dev); 1175 1303 iommu_group_put(grp); 1176 1304 1177 1305 return 0; ··· 1199 1327 * also sets the dma_api ops 1200 1328 */ 1201 1329 table_group = iommu_group_get_iommudata(grp); 1202 - ret = table_group->ops->take_ownership(table_group); 1330 + ret = table_group->ops->take_ownership(table_group, dev); 1203 1331 iommu_group_put(grp); 1204 1332 1205 1333 return ret;
+1 -1
arch/powerpc/kernel/irq.c
··· 333 333 static_call_update(ppc_get_irq, ppc_md.get_irq); 334 334 } 335 335 336 - #ifdef CONFIG_BOOKE_OR_40x 336 + #ifdef CONFIG_BOOKE 337 337 void *critirq_ctx[NR_CPUS] __read_mostly; 338 338 void *dbgirq_ctx[NR_CPUS] __read_mostly; 339 339 void *mcheckirq_ctx[NR_CPUS] __read_mostly;
+2 -2
arch/powerpc/kernel/kgdb.c
··· 45 45 { 0x0800, 0x08 /* SIGFPE */ }, /* fp unavailable */ 46 46 { 0x0900, 0x0e /* SIGALRM */ }, /* decrementer */ 47 47 { 0x0c00, 0x14 /* SIGCHLD */ }, /* system call */ 48 - #ifdef CONFIG_BOOKE_OR_40x 48 + #ifdef CONFIG_BOOKE 49 49 { 0x2002, 0x05 /* SIGTRAP */ }, /* debug */ 50 50 #if defined(CONFIG_PPC_85xx) 51 51 { 0x2010, 0x08 /* SIGFPE */ }, /* spe unavailable */ ··· 64 64 { 0x2010, 0x08 /* SIGFPE */ }, /* fp unavailable */ 65 65 { 0x2020, 0x08 /* SIGFPE */ }, /* ap unavailable */ 66 66 #endif 67 - #else /* !CONFIG_BOOKE_OR_40x */ 67 + #else /* !CONFIG_BOOKE */ 68 68 { 0x0d00, 0x05 /* SIGTRAP */ }, /* single-step */ 69 69 #if defined(CONFIG_PPC_8xx) 70 70 { 0x1000, 0x04 /* SIGILL */ }, /* software emulation */
-40
arch/powerpc/kernel/misc_32.S
··· 176 176 177 177 #endif /* CONFIG_CPU_FREQ_PMAC && CONFIG_PPC_BOOK3S_32 */ 178 178 179 - #ifdef CONFIG_40x 180 - 181 - /* 182 - * Do an IO access in real mode 183 - */ 184 - _GLOBAL(real_readb) 185 - mfmsr r7 186 - rlwinm r0,r7,0,~MSR_DR 187 - sync 188 - mtmsr r0 189 - sync 190 - isync 191 - lbz r3,0(r3) 192 - sync 193 - mtmsr r7 194 - sync 195 - isync 196 - blr 197 - _ASM_NOKPROBE_SYMBOL(real_readb) 198 - 199 - /* 200 - * Do an IO access in real mode 201 - */ 202 - _GLOBAL(real_writeb) 203 - mfmsr r7 204 - rlwinm r0,r7,0,~MSR_DR 205 - sync 206 - mtmsr r0 207 - sync 208 - isync 209 - stb r3,0(r4) 210 - sync 211 - mtmsr r7 212 - sync 213 - isync 214 - blr 215 - _ASM_NOKPROBE_SYMBOL(real_writeb) 216 - 217 - #endif /* CONFIG_40x */ 218 - 219 179 /* 220 180 * Copy a whole page. We use the dcbz instruction on the destination 221 181 * to reduce memory traffic (it eliminates the unnecessary reads of
+32 -3
arch/powerpc/kernel/pci-hotplug.c
··· 93 93 } 94 94 EXPORT_SYMBOL_GPL(pci_hp_remove_devices); 95 95 96 + static void traverse_siblings_and_scan_slot(struct device_node *start, struct pci_bus *bus) 97 + { 98 + struct device_node *dn; 99 + int slotno; 100 + 101 + u32 class = 0; 102 + 103 + if (!of_property_read_u32(start->child, "class-code", &class)) { 104 + /* Call of pci_scan_slot for non-bridge/EP case */ 105 + if (!((class >> 8) == PCI_CLASS_BRIDGE_PCI)) { 106 + slotno = PCI_SLOT(PCI_DN(start->child)->devfn); 107 + pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); 108 + return; 109 + } 110 + } 111 + 112 + /* Iterate all siblings */ 113 + for_each_child_of_node(start, dn) { 114 + class = 0; 115 + 116 + if (!of_property_read_u32(start->child, "class-code", &class)) { 117 + /* Call of pci_scan_slot on each sibling-nodes/bridge-ports */ 118 + if ((class >> 8) == PCI_CLASS_BRIDGE_PCI) { 119 + slotno = PCI_SLOT(PCI_DN(dn)->devfn); 120 + pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); 121 + } 122 + } 123 + } 124 + } 125 + 96 126 /** 97 127 * pci_hp_add_devices - adds new pci devices to bus 98 128 * @bus: the indicated PCI bus ··· 136 106 */ 137 107 void pci_hp_add_devices(struct pci_bus *bus) 138 108 { 139 - int slotno, mode, max; 109 + int mode, max; 140 110 struct pci_dev *dev; 141 111 struct pci_controller *phb; 142 112 struct device_node *dn = pci_bus_to_OF_node(bus); ··· 159 129 * order for fully rescan all the way down to pick them up. 160 130 * They can have been removed during partial hotplug. 161 131 */ 162 - slotno = PCI_SLOT(PCI_DN(dn->child)->devfn); 163 - pci_scan_slot(bus, PCI_DEVFN(slotno, 0)); 132 + traverse_siblings_and_scan_slot(dn, bus); 164 133 max = bus->busn_res.start; 165 134 /* 166 135 * Scan bridges that are already configured. We don't touch
+2 -2
arch/powerpc/kernel/process.c
··· 1573 1573 if (trap == INTERRUPT_MACHINE_CHECK || 1574 1574 trap == INTERRUPT_DATA_STORAGE || 1575 1575 trap == INTERRUPT_ALIGNMENT) { 1576 - if (IS_ENABLED(CONFIG_4xx) || IS_ENABLED(CONFIG_BOOKE)) 1576 + if (IS_ENABLED(CONFIG_BOOKE)) 1577 1577 pr_cont("DEAR: "REG" ESR: "REG" ", regs->dear, regs->esr); 1578 1578 else 1579 1579 pr_cont("DAR: "REG" DSISR: %08lx ", regs->dar, regs->dsisr); ··· 1875 1875 #if defined(CONFIG_PPC_BOOK3S_32) && defined(CONFIG_PPC_KUAP) 1876 1876 p->thread.kuap = KUAP_NONE; 1877 1877 #endif 1878 - #if defined(CONFIG_BOOKE_OR_40x) && defined(CONFIG_PPC_KUAP) 1878 + #if defined(CONFIG_BOOKE) && defined(CONFIG_PPC_KUAP) 1879 1879 p->thread.pid = MMU_NO_CONTEXT; 1880 1880 #endif 1881 1881
+8 -4
arch/powerpc/kernel/prom.c
··· 331 331 void *data) 332 332 { 333 333 const char *type = of_get_flat_dt_prop(node, "device_type", NULL); 334 + const __be32 *cpu_version = NULL; 334 335 const __be32 *prop; 335 336 const __be32 *intserv; 336 337 int i, nthreads; ··· 421 420 prop = of_get_flat_dt_prop(node, "cpu-version", NULL); 422 421 if (prop && (be32_to_cpup(prop) & 0xff000000) == 0x0f000000) { 423 422 identify_cpu(0, be32_to_cpup(prop)); 424 - seq_buf_printf(&ppc_hw_desc, "0x%04x ", be32_to_cpup(prop)); 423 + cpu_version = prop; 425 424 } 426 425 427 426 check_cpu_feature_properties(node); ··· 432 431 } 433 432 434 433 identical_pvr_fixup(node); 434 + 435 + // We can now add the CPU name & PVR to the hardware description 436 + seq_buf_printf(&ppc_hw_desc, "%s 0x%04lx ", cur_cpu_spec->cpu_name, mfspr(SPRN_PVR)); 437 + if (cpu_version) 438 + seq_buf_printf(&ppc_hw_desc, "0x%04x ", be32_to_cpup(cpu_version)); 439 + 435 440 init_mmu_slb_size(node); 436 441 437 442 #ifdef CONFIG_PPC64 ··· 887 880 DBG("Scanning CPUs ...\n"); 888 881 889 882 dt_cpu_ftrs_scan(); 890 - 891 - // We can now add the CPU name & PVR to the hardware description 892 - seq_buf_printf(&ppc_hw_desc, "%s 0x%04lx ", cur_cpu_spec->cpu_name, mfspr(SPRN_PVR)); 893 883 894 884 /* Retrieve CPU related informations from the flat tree 895 885 * (altivec support, boot CPU ID, ...)
+4
arch/powerpc/kernel/rtas.c
··· 19 19 #include <linux/lockdep.h> 20 20 #include <linux/memblock.h> 21 21 #include <linux/mutex.h> 22 + #include <linux/nospec.h> 22 23 #include <linux/of.h> 23 24 #include <linux/of_fdt.h> 24 25 #include <linux/reboot.h> ··· 1916 1915 || nret > ARRAY_SIZE(args.args) 1917 1916 || nargs + nret > ARRAY_SIZE(args.args)) 1918 1917 return -EINVAL; 1918 + 1919 + nargs = array_index_nospec(nargs, ARRAY_SIZE(args.args)); 1920 + nret = array_index_nospec(nret, ARRAY_SIZE(args.args) - nargs); 1919 1921 1920 1922 /* Copy in args. */ 1921 1923 if (copy_from_user(args.args, uargs->args,
+1
arch/powerpc/kernel/rtas_flash.c
··· 773 773 774 774 module_init(rtas_flash_init); 775 775 module_exit(rtas_flash_cleanup); 776 + MODULE_DESCRIPTION("PPC procfs firmware flash interface"); 776 777 MODULE_LICENSE("GPL");
+1 -1
arch/powerpc/kernel/setup.h
··· 29 29 static inline void setup_tlb_core_data(void) { } 30 30 #endif 31 31 32 - #ifdef CONFIG_BOOKE_OR_40x 32 + #ifdef CONFIG_BOOKE 33 33 void exc_lvl_early_init(void); 34 34 #else 35 35 static inline void exc_lvl_early_init(void) { }
+1 -1
arch/powerpc/kernel/setup_32.c
··· 176 176 } 177 177 #endif 178 178 179 - #ifdef CONFIG_BOOKE_OR_40x 179 + #ifdef CONFIG_BOOKE 180 180 void __init exc_lvl_early_init(void) 181 181 { 182 182 unsigned int i, hw_cpu;
+1 -1
arch/powerpc/kernel/time.c
··· 695 695 696 696 static void start_cpu_decrementer(void) 697 697 { 698 - #ifdef CONFIG_BOOKE_OR_40x 698 + #ifdef CONFIG_BOOKE 699 699 unsigned int tcr; 700 700 701 701 /* Clear any pending timer interrupts */
+1 -1
arch/powerpc/kernel/traps.c
··· 2244 2244 ; 2245 2245 } 2246 2246 2247 - #if defined(CONFIG_BOOKE_WDT) || defined(CONFIG_40x) 2247 + #ifdef CONFIG_BOOKE_WDT 2248 2248 DEFINE_INTERRUPT_HANDLER_NMI(WatchdogException) 2249 2249 { 2250 2250 printk (KERN_EMERG "PowerPC Book-E Watchdog Exception\n");
-3
arch/powerpc/kernel/udbg.c
··· 49 49 #elif defined(CONFIG_PPC_EARLY_DEBUG_44x) 50 50 /* PPC44x debug */ 51 51 udbg_init_44x_as1(); 52 - #elif defined(CONFIG_PPC_EARLY_DEBUG_40x) 53 - /* PPC40x debug */ 54 - udbg_init_40x_realmode(); 55 52 #elif defined(CONFIG_PPC_EARLY_DEBUG_CPM) 56 53 udbg_init_cpm(); 57 54 #elif defined(CONFIG_PPC_EARLY_DEBUG_USBGECKO)
-23
arch/powerpc/kernel/udbg_16550.c
··· 274 274 275 275 #endif /* CONFIG_PPC_EARLY_DEBUG_44x */ 276 276 277 - #ifdef CONFIG_PPC_EARLY_DEBUG_40x 278 - 279 - static u8 udbg_uart_in_40x(unsigned int reg) 280 - { 281 - return real_readb((void __iomem *)CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR 282 - + reg); 283 - } 284 - 285 - static void udbg_uart_out_40x(unsigned int reg, u8 val) 286 - { 287 - real_writeb(val, (void __iomem *)CONFIG_PPC_EARLY_DEBUG_40x_PHYSADDR 288 - + reg); 289 - } 290 - 291 - void __init udbg_init_40x_realmode(void) 292 - { 293 - udbg_uart_in = udbg_uart_in_40x; 294 - udbg_uart_out = udbg_uart_out_40x; 295 - udbg_use_uart(); 296 - } 297 - 298 - #endif /* CONFIG_PPC_EARLY_DEBUG_40x */ 299 - 300 277 #ifdef CONFIG_PPC_EARLY_DEBUG_16550 301 278 302 279 static void __iomem *udbg_uart_early_addr;
+38 -17
arch/powerpc/kexec/core_64.c
··· 467 467 * @fdt: Flattened device tree of the kernel. 468 468 * 469 469 * Returns 0 on success, negative errno on error. 470 + * 471 + * Note: expecting no subnodes under /cpus/<node> with device_type == "cpu". 472 + * If this changes, update this function to include them. 470 473 */ 471 474 int update_cpus_node(void *fdt) 472 475 { 476 + int prev_node_offset; 477 + const char *device_type; 478 + const struct fdt_property *prop; 473 479 struct device_node *cpus_node, *dn; 474 480 int cpus_offset, cpus_subnode_offset, ret = 0; 475 481 ··· 486 480 return cpus_offset; 487 481 } 488 482 489 - if (cpus_offset > 0) { 490 - ret = fdt_del_node(fdt, cpus_offset); 491 - if (ret < 0) { 492 - pr_err("Error deleting /cpus node: %s\n", fdt_strerror(ret)); 493 - return -EINVAL; 483 + prev_node_offset = cpus_offset; 484 + /* Delete sub-nodes of /cpus node with device_type == "cpu" */ 485 + for (cpus_subnode_offset = fdt_first_subnode(fdt, cpus_offset); cpus_subnode_offset >= 0;) { 486 + /* Ignore nodes that do not have a device_type property or device_type != "cpu" */ 487 + prop = fdt_get_property(fdt, cpus_subnode_offset, "device_type", NULL); 488 + if (!prop || strcmp(prop->data, "cpu")) { 489 + prev_node_offset = cpus_subnode_offset; 490 + goto next_node; 494 491 } 492 + 493 + ret = fdt_del_node(fdt, cpus_subnode_offset); 494 + if (ret < 0) { 495 + pr_err("Failed to delete a cpus sub-node: %s\n", fdt_strerror(ret)); 496 + return ret; 497 + } 498 + next_node: 499 + if (prev_node_offset == cpus_offset) 500 + cpus_subnode_offset = fdt_first_subnode(fdt, cpus_offset); 501 + else 502 + cpus_subnode_offset = fdt_next_subnode(fdt, prev_node_offset); 495 503 } 496 504 497 - /* Add cpus node to fdt */ 498 - cpus_offset = fdt_add_subnode(fdt, fdt_path_offset(fdt, "/"), "cpus"); 499 - if (cpus_offset < 0) { 500 - pr_err("Error creating /cpus node: %s\n", fdt_strerror(cpus_offset)); 505 + cpus_node = of_find_node_by_path("/cpus"); 506 + /* Fail here to avoid kexec/kdump kernel boot hung */ 507 + if (!cpus_node) { 508 + pr_err("No /cpus node found\n"); 501 509 return -EINVAL; 502 510 } 503 511 504 - /* Add cpus node properties */ 505 - cpus_node = of_find_node_by_path("/cpus"); 506 - ret = add_node_props(fdt, cpus_offset, cpus_node); 507 - of_node_put(cpus_node); 508 - if (ret < 0) 509 - return ret; 512 + /* Add all /cpus sub-nodes of device_type == "cpu" to FDT */ 513 + for_each_child_of_node(cpus_node, dn) { 514 + /* Ignore device nodes that do not have a device_type property 515 + * or device_type != "cpu". 516 + */ 517 + device_type = of_get_property(dn, "device_type", NULL); 518 + if (!device_type || strcmp(device_type, "cpu")) 519 + continue; 510 520 511 - /* Loop through all subnodes of cpus and add them to fdt */ 512 - for_each_node_by_type(dn, "cpu") { 513 521 cpus_subnode_offset = fdt_add_subnode(fdt, cpus_offset, dn->full_name); 514 522 if (cpus_subnode_offset < 0) { 515 523 pr_err("Unable to add %s subnode: %s\n", dn->full_name, ··· 537 517 goto out; 538 518 } 539 519 out: 520 + of_node_put(cpus_node); 540 521 of_node_put(dn); 541 522 return ret; 542 523 }
+9 -3
arch/powerpc/kexec/elf_64.c
··· 23 23 #include <linux/of_fdt.h> 24 24 #include <linux/slab.h> 25 25 #include <linux/types.h> 26 + #include <asm/kexec_ranges.h> 26 27 27 28 static void *elf64_load(struct kimage *image, char *kernel_buf, 28 29 unsigned long kernel_len, char *initrd, ··· 37 36 const void *slave_code; 38 37 struct elfhdr ehdr; 39 38 char *modified_cmdline = NULL; 39 + struct crash_mem *rmem = NULL; 40 40 struct kexec_elf_info elf_info; 41 41 struct kexec_buf kbuf = { .image = image, .buf_min = 0, 42 42 .buf_max = ppc64_rma_size }; ··· 104 102 kexec_dprintk("Loaded initrd at 0x%lx\n", initrd_load_addr); 105 103 } 106 104 105 + ret = get_reserved_memory_ranges(&rmem); 106 + if (ret) 107 + goto out; 108 + 107 109 fdt = of_kexec_alloc_and_setup_fdt(image, initrd_load_addr, 108 110 initrd_len, cmdline, 109 - kexec_extra_fdt_size_ppc64(image)); 111 + kexec_extra_fdt_size_ppc64(image, rmem)); 110 112 if (!fdt) { 111 113 pr_err("Error setting up the new device tree.\n"); 112 114 ret = -EINVAL; 113 115 goto out; 114 116 } 115 117 116 - ret = setup_new_fdt_ppc64(image, fdt, initrd_load_addr, 117 - initrd_len, cmdline); 118 + ret = setup_new_fdt_ppc64(image, fdt, rmem); 118 119 if (ret) 119 120 goto out_free_fdt; 120 121 ··· 151 146 out_free_fdt: 152 147 kvfree(fdt); 153 148 out: 149 + kfree(rmem); 154 150 kfree(modified_cmdline); 155 151 kexec_free_elf_info(&elf_info); 156 152
+35 -55
arch/powerpc/kexec/file_load_64.c
··· 18 18 #include <linux/of_fdt.h> 19 19 #include <linux/libfdt.h> 20 20 #include <linux/of.h> 21 + #include <linux/of_address.h> 21 22 #include <linux/memblock.h> 22 23 #include <linux/slab.h> 23 24 #include <linux/vmalloc.h> ··· 377 376 static int add_usable_mem_property(void *fdt, struct device_node *dn, 378 377 struct umem_info *um_info) 379 378 { 380 - int n_mem_addr_cells, n_mem_size_cells, node; 379 + int node; 381 380 char path[NODE_PATH_LEN]; 382 - int i, len, ranges, ret; 383 - const __be32 *prop; 384 - u64 base, end; 381 + int i, ret; 382 + u64 base, size; 385 383 386 384 of_node_get(dn); 387 385 ··· 399 399 goto out; 400 400 } 401 401 402 - /* Get the address & size cells */ 403 - n_mem_addr_cells = of_n_addr_cells(dn); 404 - n_mem_size_cells = of_n_size_cells(dn); 405 - kexec_dprintk("address cells: %d, size cells: %d\n", n_mem_addr_cells, 406 - n_mem_size_cells); 407 - 408 402 um_info->idx = 0; 409 403 if (!check_realloc_usable_mem(um_info, 2)) { 410 404 ret = -ENOMEM; 411 - goto out; 412 - } 413 - 414 - prop = of_get_property(dn, "reg", &len); 415 - if (!prop || len <= 0) { 416 - ret = 0; 417 405 goto out; 418 406 } 419 407 ··· 409 421 * "reg" property represents sequence of (addr,size) tuples 410 422 * each representing a memory range. 411 423 */ 412 - ranges = (len >> 2) / (n_mem_addr_cells + n_mem_size_cells); 424 + for (i = 0; ; i++) { 425 + ret = of_property_read_reg(dn, i, &base, &size); 426 + if (ret) 427 + break; 413 428 414 - for (i = 0; i < ranges; i++) { 415 - base = of_read_number(prop, n_mem_addr_cells); 416 - prop += n_mem_addr_cells; 417 - end = base + of_read_number(prop, n_mem_size_cells) - 1; 418 - prop += n_mem_size_cells; 419 - 420 - ret = add_usable_mem(um_info, base, end); 429 + ret = add_usable_mem(um_info, base, base + size - 1); 421 430 if (ret) 422 431 goto out; 423 432 } 433 + 434 + // No reg or empty reg? Skip this node. 435 + if (i == 0) 436 + goto out; 424 437 425 438 /* 426 439 * No kdump kernel usable memory found in this memory node. ··· 792 803 return size; 793 804 } 794 805 795 - static unsigned int kdump_extra_fdt_size_ppc64(struct kimage *image) 806 + static unsigned int kdump_extra_fdt_size_ppc64(struct kimage *image, unsigned int cpu_nodes) 796 807 { 797 - unsigned int cpu_nodes, extra_size = 0; 798 - struct device_node *dn; 808 + unsigned int extra_size = 0; 799 809 u64 usm_entries; 800 810 #ifdef CONFIG_CRASH_HOTPLUG 801 811 unsigned int possible_cpu_nodes; ··· 813 825 (2 * (resource_size(&crashk_res) / drmem_lmb_size()))); 814 826 extra_size += (unsigned int)(usm_entries * sizeof(u64)); 815 827 } 816 - 817 - /* 818 - * Get the number of CPU nodes in the current DT. This allows to 819 - * reserve places for CPU nodes added since the boot time. 820 - */ 821 - cpu_nodes = 0; 822 - for_each_node_by_type(dn, "cpu") { 823 - cpu_nodes++; 824 - } 825 - 826 - if (cpu_nodes > boot_cpu_node_count) 827 - extra_size += (cpu_nodes - boot_cpu_node_count) * cpu_node_size(); 828 828 829 829 #ifdef CONFIG_CRASH_HOTPLUG 830 830 /* ··· 837 861 * 838 862 * Returns the estimated extra size needed for kexec/kdump kernel FDT. 839 863 */ 840 - unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image) 864 + unsigned int kexec_extra_fdt_size_ppc64(struct kimage *image, struct crash_mem *rmem) 841 865 { 842 - unsigned int extra_size = 0; 866 + struct device_node *dn; 867 + unsigned int cpu_nodes = 0, extra_size = 0; 843 868 844 869 // Budget some space for the password blob. There's already extra space 845 870 // for the key name 846 871 if (plpks_is_available()) 847 872 extra_size += (unsigned int)plpks_get_passwordlen(); 848 873 849 - return extra_size + kdump_extra_fdt_size_ppc64(image); 874 + /* Get the number of CPU nodes in the current device tree */ 875 + for_each_node_by_type(dn, "cpu") { 876 + cpu_nodes++; 877 + } 878 + 879 + /* Consider extra space for CPU nodes added since the boot time */ 880 + if (cpu_nodes > boot_cpu_node_count) 881 + extra_size += (cpu_nodes - boot_cpu_node_count) * cpu_node_size(); 882 + 883 + /* Consider extra space for reserved memory ranges if any */ 884 + if (rmem->nr_ranges > 0) 885 + extra_size += sizeof(struct fdt_reserve_entry) * rmem->nr_ranges; 886 + 887 + return extra_size + kdump_extra_fdt_size_ppc64(image, cpu_nodes); 850 888 } 851 889 852 890 static int copy_property(void *fdt, int node_offset, const struct device_node *dn, ··· 914 924 * being loaded. 915 925 * @image: kexec image being loaded. 916 926 * @fdt: Flattened device tree for the next kernel. 917 - * @initrd_load_addr: Address where the next initrd will be loaded. 918 - * @initrd_len: Size of the next initrd, or 0 if there will be none. 919 - * @cmdline: Command line for the next kernel, or NULL if there will 920 - * be none. 927 + * @rmem: Reserved memory ranges. 921 928 * 922 929 * Returns 0 on success, negative errno on error. 923 930 */ 924 - int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, 925 - unsigned long initrd_load_addr, 926 - unsigned long initrd_len, const char *cmdline) 931 + int setup_new_fdt_ppc64(const struct kimage *image, void *fdt, struct crash_mem *rmem) 927 932 { 928 - struct crash_mem *umem = NULL, *rmem = NULL; 933 + struct crash_mem *umem = NULL; 929 934 int i, nr_ranges, ret; 930 935 931 936 #ifdef CONFIG_CRASH_DUMP ··· 976 991 goto out; 977 992 978 993 /* Update memory reserve map */ 979 - ret = get_reserved_memory_ranges(&rmem); 980 - if (ret) 981 - goto out; 982 - 983 994 nr_ranges = rmem ? rmem->nr_ranges : 0; 984 995 for (i = 0; i < nr_ranges; i++) { 985 996 u64 base, size; ··· 995 1014 ret = plpks_populate_fdt(fdt); 996 1015 997 1016 out: 998 - kfree(rmem); 999 1017 kfree(umem); 1000 1018 return ret; 1001 1019 }
+101 -2
arch/powerpc/kvm/book3s_hv.c
··· 2305 2305 *val = get_reg_val(id, kvmppc_get_siar_hv(vcpu)); 2306 2306 break; 2307 2307 case KVM_REG_PPC_SDAR: 2308 - *val = get_reg_val(id, kvmppc_get_siar_hv(vcpu)); 2308 + *val = get_reg_val(id, kvmppc_get_sdar_hv(vcpu)); 2309 2309 break; 2310 2310 case KVM_REG_PPC_SIER: 2311 2311 *val = get_reg_val(id, kvmppc_get_sier_hv(vcpu, 0)); ··· 2348 2348 break; 2349 2349 case KVM_REG_PPC_DAWRX1: 2350 2350 *val = get_reg_val(id, kvmppc_get_dawrx1_hv(vcpu)); 2351 + break; 2352 + case KVM_REG_PPC_DEXCR: 2353 + *val = get_reg_val(id, kvmppc_get_dexcr_hv(vcpu)); 2354 + break; 2355 + case KVM_REG_PPC_HASHKEYR: 2356 + *val = get_reg_val(id, kvmppc_get_hashkeyr_hv(vcpu)); 2357 + break; 2358 + case KVM_REG_PPC_HASHPKEYR: 2359 + *val = get_reg_val(id, kvmppc_get_hashpkeyr_hv(vcpu)); 2351 2360 break; 2352 2361 case KVM_REG_PPC_CIABR: 2353 2362 *val = get_reg_val(id, kvmppc_get_ciabr_hv(vcpu)); ··· 2549 2540 vcpu->arch.mmcrs = set_reg_val(id, *val); 2550 2541 break; 2551 2542 case KVM_REG_PPC_MMCR3: 2552 - *val = get_reg_val(id, vcpu->arch.mmcr[3]); 2543 + kvmppc_set_mmcr_hv(vcpu, 3, set_reg_val(id, *val)); 2553 2544 break; 2554 2545 case KVM_REG_PPC_PMC1 ... KVM_REG_PPC_PMC8: 2555 2546 i = id - KVM_REG_PPC_PMC1; ··· 2600 2591 break; 2601 2592 case KVM_REG_PPC_DAWRX1: 2602 2593 kvmppc_set_dawrx1_hv(vcpu, set_reg_val(id, *val) & ~DAWRX_HYP); 2594 + break; 2595 + case KVM_REG_PPC_DEXCR: 2596 + kvmppc_set_dexcr_hv(vcpu, set_reg_val(id, *val)); 2597 + break; 2598 + case KVM_REG_PPC_HASHKEYR: 2599 + kvmppc_set_hashkeyr_hv(vcpu, set_reg_val(id, *val)); 2600 + break; 2601 + case KVM_REG_PPC_HASHPKEYR: 2602 + kvmppc_set_hashpkeyr_hv(vcpu, set_reg_val(id, *val)); 2603 2603 break; 2604 2604 case KVM_REG_PPC_CIABR: 2605 2605 kvmppc_set_ciabr_hv(vcpu, set_reg_val(id, *val)); ··· 4126 4108 } 4127 4109 } 4128 4110 4111 + /* Helper functions for reading L2's stats from L1's VPA */ 4112 + #ifdef CONFIG_PPC_PSERIES 4113 + static DEFINE_PER_CPU(u64, l1_to_l2_cs); 4114 + static DEFINE_PER_CPU(u64, l2_to_l1_cs); 4115 + static DEFINE_PER_CPU(u64, l2_runtime_agg); 4116 + 4117 + int kvmhv_get_l2_counters_status(void) 4118 + { 4119 + return firmware_has_feature(FW_FEATURE_LPAR) && 4120 + get_lppaca()->l2_counters_enable; 4121 + } 4122 + 4123 + void kvmhv_set_l2_counters_status(int cpu, bool status) 4124 + { 4125 + if (!firmware_has_feature(FW_FEATURE_LPAR)) 4126 + return; 4127 + if (status) 4128 + lppaca_of(cpu).l2_counters_enable = 1; 4129 + else 4130 + lppaca_of(cpu).l2_counters_enable = 0; 4131 + } 4132 + 4133 + int kmvhv_counters_tracepoint_regfunc(void) 4134 + { 4135 + int cpu; 4136 + 4137 + for_each_present_cpu(cpu) { 4138 + kvmhv_set_l2_counters_status(cpu, true); 4139 + } 4140 + return 0; 4141 + } 4142 + 4143 + void kmvhv_counters_tracepoint_unregfunc(void) 4144 + { 4145 + int cpu; 4146 + 4147 + for_each_present_cpu(cpu) { 4148 + kvmhv_set_l2_counters_status(cpu, false); 4149 + } 4150 + } 4151 + 4152 + static void do_trace_nested_cs_time(struct kvm_vcpu *vcpu) 4153 + { 4154 + struct lppaca *lp = get_lppaca(); 4155 + u64 l1_to_l2_ns, l2_to_l1_ns, l2_runtime_ns; 4156 + u64 *l1_to_l2_cs_ptr = this_cpu_ptr(&l1_to_l2_cs); 4157 + u64 *l2_to_l1_cs_ptr = this_cpu_ptr(&l2_to_l1_cs); 4158 + u64 *l2_runtime_agg_ptr = this_cpu_ptr(&l2_runtime_agg); 4159 + 4160 + l1_to_l2_ns = tb_to_ns(be64_to_cpu(lp->l1_to_l2_cs_tb)); 4161 + l2_to_l1_ns = tb_to_ns(be64_to_cpu(lp->l2_to_l1_cs_tb)); 4162 + l2_runtime_ns = tb_to_ns(be64_to_cpu(lp->l2_runtime_tb)); 4163 + trace_kvmppc_vcpu_stats(vcpu, l1_to_l2_ns - *l1_to_l2_cs_ptr, 4164 + l2_to_l1_ns - *l2_to_l1_cs_ptr, 4165 + l2_runtime_ns - *l2_runtime_agg_ptr); 4166 + *l1_to_l2_cs_ptr = l1_to_l2_ns; 4167 + *l2_to_l1_cs_ptr = l2_to_l1_ns; 4168 + *l2_runtime_agg_ptr = l2_runtime_ns; 4169 + } 4170 + 4171 + #else 4172 + int kvmhv_get_l2_counters_status(void) 4173 + { 4174 + return 0; 4175 + } 4176 + 4177 + static void do_trace_nested_cs_time(struct kvm_vcpu *vcpu) 4178 + { 4179 + } 4180 + #endif 4181 + 4129 4182 static int kvmhv_vcpu_entry_nestedv2(struct kvm_vcpu *vcpu, u64 time_limit, 4130 4183 unsigned long lpcr, u64 *tb) 4131 4184 { ··· 4204 4115 unsigned long msr, i; 4205 4116 int trap; 4206 4117 long rc; 4118 + 4119 + if (vcpu->arch.doorbell_request) { 4120 + vcpu->arch.doorbell_request = 0; 4121 + kvmppc_set_dpdes(vcpu, 1); 4122 + } 4207 4123 4208 4124 io = &vcpu->arch.nestedv2_io; 4209 4125 ··· 4249 4155 return -EINVAL; 4250 4156 4251 4157 timer_rearm_host_dec(*tb); 4158 + 4159 + /* Record context switch and guest_run_time data */ 4160 + if (kvmhv_get_l2_counters_status()) 4161 + do_trace_nested_cs_time(vcpu); 4252 4162 4253 4163 return trap; 4254 4164 } ··· 6617 6519 6618 6520 module_init(kvmppc_book3s_init_hv); 6619 6521 module_exit(kvmppc_book3s_exit_hv); 6522 + MODULE_DESCRIPTION("KVM on Book3S (POWER8 and later) in hypervisor mode"); 6620 6523 MODULE_LICENSE("GPL"); 6621 6524 MODULE_ALIAS_MISCDEV(KVM_MINOR); 6622 6525 MODULE_ALIAS("devname:kvm");
+3
arch/powerpc/kvm/book3s_hv.h
··· 116 116 KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawr1, 64, KVMPPC_GSID_DAWR1) 117 117 KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx0, 64, KVMPPC_GSID_DAWRX0) 118 118 KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dawrx1, 64, KVMPPC_GSID_DAWRX1) 119 + KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(dexcr, 64, KVMPPC_GSID_DEXCR) 120 + KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(hashkeyr, 64, KVMPPC_GSID_HASHKEYR) 121 + KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(hashpkeyr, 64, KVMPPC_GSID_HASHPKEYR) 119 122 KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ciabr, 64, KVMPPC_GSID_CIABR) 120 123 KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(wort, 64, KVMPPC_GSID_WORT) 121 124 KVMPPC_BOOK3S_HV_VCPU_ACCESSOR(ppr, 64, KVMPPC_GSID_PPR)
+25
arch/powerpc/kvm/book3s_hv_nestedv2.c
··· 193 193 case KVMPPC_GSID_DAWRX1: 194 194 rc = kvmppc_gse_put_u32(gsb, iden, vcpu->arch.dawrx1); 195 195 break; 196 + case KVMPPC_GSID_DEXCR: 197 + rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.dexcr); 198 + break; 199 + case KVMPPC_GSID_HASHKEYR: 200 + rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.hashkeyr); 201 + break; 202 + case KVMPPC_GSID_HASHPKEYR: 203 + rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.hashpkeyr); 204 + break; 196 205 case KVMPPC_GSID_CIABR: 197 206 rc = kvmppc_gse_put_u64(gsb, iden, vcpu->arch.ciabr); 198 207 break; ··· 319 310 case KVMPPC_GSID_VTB: 320 311 rc = kvmppc_gse_put_u64(gsb, iden, 321 312 vcpu->arch.vcore->vtb); 313 + break; 314 + case KVMPPC_GSID_DPDES: 315 + rc = kvmppc_gse_put_u64(gsb, iden, 316 + vcpu->arch.vcore->dpdes); 322 317 break; 323 318 case KVMPPC_GSID_LPCR: 324 319 rc = kvmppc_gse_put_u64(gsb, iden, ··· 454 441 case KVMPPC_GSID_DAWRX1: 455 442 vcpu->arch.dawrx1 = kvmppc_gse_get_u32(gse); 456 443 break; 444 + case KVMPPC_GSID_DEXCR: 445 + vcpu->arch.dexcr = kvmppc_gse_get_u64(gse); 446 + break; 447 + case KVMPPC_GSID_HASHKEYR: 448 + vcpu->arch.hashkeyr = kvmppc_gse_get_u64(gse); 449 + break; 450 + case KVMPPC_GSID_HASHPKEYR: 451 + vcpu->arch.hashpkeyr = kvmppc_gse_get_u64(gse); 452 + break; 457 453 case KVMPPC_GSID_CIABR: 458 454 vcpu->arch.ciabr = kvmppc_gse_get_u64(gse); 459 455 break; ··· 564 542 break; 565 543 case KVMPPC_GSID_VTB: 566 544 vcpu->arch.vcore->vtb = kvmppc_gse_get_u64(gse); 545 + break; 546 + case KVMPPC_GSID_DPDES: 547 + vcpu->arch.vcore->dpdes = kvmppc_gse_get_u64(gse); 567 548 break; 568 549 case KVMPPC_GSID_LPCR: 569 550 vcpu->arch.vcore->lpcr = kvmppc_gse_get_u64(gse);
+1
arch/powerpc/kvm/book3s_pr.c
··· 2111 2111 module_init(kvmppc_book3s_init_pr); 2112 2112 module_exit(kvmppc_book3s_exit_pr); 2113 2113 2114 + MODULE_DESCRIPTION("KVM on Book3S without using hypervisor mode"); 2114 2115 MODULE_LICENSE("GPL"); 2115 2116 MODULE_ALIAS_MISCDEV(KVM_MINOR); 2116 2117 MODULE_ALIAS("devname:kvm");
+2 -1
arch/powerpc/kvm/test-guest-state-buffer.c
··· 151 151 i++; 152 152 } 153 153 154 - for (u16 iden = KVMPPC_GSID_GPR(0); iden <= KVMPPC_GSID_CTRL; iden++) { 154 + for (u16 iden = KVMPPC_GSID_GPR(0); iden <= KVMPPC_GSE_DW_REGS_END; iden++) { 155 155 kvmppc_gsbm_set(&gsbm, iden); 156 156 kvmppc_gsbm_set(&gsbm1, iden); 157 157 KUNIT_EXPECT_TRUE(test, kvmppc_gsbm_test(&gsbm, iden)); ··· 325 325 326 326 kunit_test_suites(&guest_state_buffer_test_suite); 327 327 328 + MODULE_DESCRIPTION("KUnit tests for Guest State Buffer APIs"); 328 329 MODULE_LICENSE("GPL");
+29
arch/powerpc/kvm/trace_hv.h
··· 512 512 __entry->vcpu_id, __entry->exit, __entry->ret) 513 513 ); 514 514 515 + #ifdef CONFIG_PPC_PSERIES 516 + 517 + TRACE_EVENT_FN_COND(kvmppc_vcpu_stats, 518 + TP_PROTO(struct kvm_vcpu *vcpu, u64 l1_to_l2_cs, u64 l2_to_l1_cs, u64 l2_runtime), 519 + 520 + TP_ARGS(vcpu, l1_to_l2_cs, l2_to_l1_cs, l2_runtime), 521 + 522 + TP_CONDITION(l1_to_l2_cs || l2_to_l1_cs || l2_runtime), 523 + 524 + TP_STRUCT__entry( 525 + __field(int, vcpu_id) 526 + __field(u64, l1_to_l2_cs) 527 + __field(u64, l2_to_l1_cs) 528 + __field(u64, l2_runtime) 529 + ), 530 + 531 + TP_fast_assign( 532 + __entry->vcpu_id = vcpu->vcpu_id; 533 + __entry->l1_to_l2_cs = l1_to_l2_cs; 534 + __entry->l2_to_l1_cs = l2_to_l1_cs; 535 + __entry->l2_runtime = l2_runtime; 536 + ), 537 + 538 + TP_printk("VCPU %d: l1_to_l2_cs_time=%llu ns l2_to_l1_cs_time=%llu ns l2_runtime=%llu ns", 539 + __entry->vcpu_id, __entry->l1_to_l2_cs, 540 + __entry->l2_to_l1_cs, __entry->l2_runtime), 541 + kmvhv_counters_tracepoint_regfunc, kmvhv_counters_tracepoint_unregfunc 542 + ); 543 + #endif 515 544 #endif /* _TRACE_KVM_HV_H */ 516 545 517 546 /* This part must be outside protection */
+80 -4
arch/powerpc/mm/book3s64/radix_pgtable.c
··· 17 17 #include <linux/hugetlb.h> 18 18 #include <linux/string_helpers.h> 19 19 #include <linux/memory.h> 20 + #include <linux/kfence.h> 20 21 21 22 #include <asm/pgalloc.h> 22 23 #include <asm/mmu_context.h> ··· 32 31 #include <asm/uaccess.h> 33 32 #include <asm/ultravisor.h> 34 33 #include <asm/set_memory.h> 34 + #include <asm/kfence.h> 35 35 36 36 #include <trace/events/thp.h> 37 37 ··· 295 293 296 294 static int __meminit create_physical_mapping(unsigned long start, 297 295 unsigned long end, 298 - int nid, pgprot_t _prot) 296 + int nid, pgprot_t _prot, 297 + unsigned long mapping_sz_limit) 299 298 { 300 299 unsigned long vaddr, addr, mapping_size = 0; 301 300 bool prev_exec, exec = false; ··· 304 301 int psize; 305 302 unsigned long max_mapping_size = memory_block_size; 306 303 307 - if (debug_pagealloc_enabled_or_kfence()) 304 + if (mapping_sz_limit < max_mapping_size) 305 + max_mapping_size = mapping_sz_limit; 306 + 307 + if (debug_pagealloc_enabled()) 308 308 max_mapping_size = PAGE_SIZE; 309 309 310 310 start = ALIGN(start, PAGE_SIZE); ··· 362 356 return 0; 363 357 } 364 358 359 + #ifdef CONFIG_KFENCE 360 + static bool __ro_after_init kfence_early_init = !!CONFIG_KFENCE_SAMPLE_INTERVAL; 361 + 362 + static int __init parse_kfence_early_init(char *arg) 363 + { 364 + int val; 365 + 366 + if (get_option(&arg, &val)) 367 + kfence_early_init = !!val; 368 + return 0; 369 + } 370 + early_param("kfence.sample_interval", parse_kfence_early_init); 371 + 372 + static inline phys_addr_t alloc_kfence_pool(void) 373 + { 374 + phys_addr_t kfence_pool; 375 + 376 + /* 377 + * TODO: Support to enable KFENCE after bootup depends on the ability to 378 + * split page table mappings. As such support is not currently 379 + * implemented for radix pagetables, support enabling KFENCE 380 + * only at system startup for now. 381 + * 382 + * After support for splitting mappings is available on radix, 383 + * alloc_kfence_pool() & map_kfence_pool() can be dropped and 384 + * mapping for __kfence_pool memory can be 385 + * split during arch_kfence_init_pool(). 386 + */ 387 + if (!kfence_early_init) 388 + goto no_kfence; 389 + 390 + kfence_pool = memblock_phys_alloc(KFENCE_POOL_SIZE, PAGE_SIZE); 391 + if (!kfence_pool) 392 + goto no_kfence; 393 + 394 + memblock_mark_nomap(kfence_pool, KFENCE_POOL_SIZE); 395 + return kfence_pool; 396 + 397 + no_kfence: 398 + disable_kfence(); 399 + return 0; 400 + } 401 + 402 + static inline void map_kfence_pool(phys_addr_t kfence_pool) 403 + { 404 + if (!kfence_pool) 405 + return; 406 + 407 + if (create_physical_mapping(kfence_pool, kfence_pool + KFENCE_POOL_SIZE, 408 + -1, PAGE_KERNEL, PAGE_SIZE)) 409 + goto err; 410 + 411 + memblock_clear_nomap(kfence_pool, KFENCE_POOL_SIZE); 412 + __kfence_pool = __va(kfence_pool); 413 + return; 414 + 415 + err: 416 + memblock_phys_free(kfence_pool, KFENCE_POOL_SIZE); 417 + disable_kfence(); 418 + } 419 + #else 420 + static inline phys_addr_t alloc_kfence_pool(void) { return 0; } 421 + static inline void map_kfence_pool(phys_addr_t kfence_pool) { } 422 + #endif 423 + 365 424 static void __init radix_init_pgtable(void) 366 425 { 426 + phys_addr_t kfence_pool; 367 427 unsigned long rts_field; 368 428 phys_addr_t start, end; 369 429 u64 i; 370 430 371 431 /* We don't support slb for radix */ 372 432 slb_set_size(0); 433 + 434 + kfence_pool = alloc_kfence_pool(); 373 435 374 436 /* 375 437 * Create the linear mapping ··· 455 381 } 456 382 457 383 WARN_ON(create_physical_mapping(start, end, 458 - -1, PAGE_KERNEL)); 384 + -1, PAGE_KERNEL, ~0UL)); 459 385 } 386 + 387 + map_kfence_pool(kfence_pool); 460 388 461 389 if (!cpu_has_feature(CPU_FTR_HVMODE) && 462 390 cpu_has_feature(CPU_FTR_P9_RADIX_PREFETCH_BUG)) { ··· 951 875 } 952 876 953 877 return create_physical_mapping(__pa(start), __pa(end), 954 - nid, prot); 878 + nid, prot, ~0UL); 955 879 } 956 880 957 881 int __meminit radix__remove_section_mapping(unsigned long start, unsigned long end)
+1 -3
arch/powerpc/mm/drmem.c
··· 491 491 const __be32 *prop; 492 492 493 493 dn = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); 494 - if (!dn) { 495 - pr_info("No dynamic reconfiguration memory found\n"); 494 + if (!dn) 496 495 return 0; 497 - } 498 496 499 497 if (init_drmem_lmb_size(dn)) { 500 498 of_node_put(dn);
+2 -2
arch/powerpc/mm/fault.c
··· 368 368 * Define the correct "is_write" bit in error_code based 369 369 * on the processor family 370 370 */ 371 - #if (defined(CONFIG_4xx) || defined(CONFIG_BOOKE)) 371 + #ifdef CONFIG_BOOKE 372 372 #define page_fault_is_write(__err) ((__err) & ESR_DST) 373 373 #else 374 374 #define page_fault_is_write(__err) ((__err) & DSISR_ISSTORE) 375 375 #endif 376 376 377 - #if defined(CONFIG_4xx) || defined(CONFIG_BOOKE) 377 + #ifdef CONFIG_BOOKE 378 378 #define page_fault_is_bad(__err) (0) 379 379 #elif defined(CONFIG_PPC_8xx) 380 380 #define page_fault_is_bad(__err) ((__err) & DSISR_NOEXEC_OR_G)
+3
arch/powerpc/mm/init-common.c
··· 31 31 32 32 bool disable_kuep = !IS_ENABLED(CONFIG_PPC_KUEP); 33 33 bool disable_kuap = !IS_ENABLED(CONFIG_PPC_KUAP); 34 + #ifdef CONFIG_KFENCE 35 + bool __ro_after_init kfence_disabled; 36 + #endif 34 37 35 38 static int __init parse_nosmep(char *p) 36 39 {
+1 -1
arch/powerpc/mm/mmu_context.c
··· 21 21 #ifdef CONFIG_PPC_BOOK3S_32 22 22 tsk->thread.sr0 = mm->context.sr0; 23 23 #endif 24 - #if defined(CONFIG_BOOKE_OR_40x) && defined(CONFIG_PPC_KUAP) 24 + #if defined(CONFIG_BOOKE) && defined(CONFIG_PPC_KUAP) 25 25 tsk->thread.pid = mm->context.id; 26 26 #endif 27 27 }
+4 -4
arch/powerpc/mm/mmu_decl.h
··· 20 20 #include <asm/trace.h> 21 21 22 22 /* 23 - * On 40x and 8xx, we directly inline tlbia and tlbivax 23 + * On 8xx, we directly inline tlbia 24 24 */ 25 - #if defined(CONFIG_40x) || defined(CONFIG_PPC_8xx) 25 + #ifdef CONFIG_PPC_8xx 26 26 static inline void _tlbil_all(void) 27 27 { 28 28 asm volatile ("sync; tlbia; isync" : : : "memory"); ··· 35 35 } 36 36 #define _tlbil_pid_noind(pid) _tlbil_pid(pid) 37 37 38 - #else /* CONFIG_40x || CONFIG_PPC_8xx */ 38 + #else /* CONFIG_PPC_8xx */ 39 39 extern void _tlbil_all(void); 40 40 extern void _tlbil_pid(unsigned int pid); 41 41 #ifdef CONFIG_PPC_BOOK3E_64 ··· 43 43 #else 44 44 #define _tlbil_pid_noind(pid) _tlbil_pid(pid) 45 45 #endif 46 - #endif /* !(CONFIG_40x || CONFIG_PPC_8xx) */ 46 + #endif /* !CONFIG_PPC_8xx */ 47 47 48 48 /* 49 49 * On 8xx, we directly inline tlbie, on others, it's extern
-161
arch/powerpc/mm/nohash/40x.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - * This file contains the routines for initializing the MMU 4 - * on the 4xx series of chips. 5 - * -- paulus 6 - * 7 - * Derived from arch/ppc/mm/init.c: 8 - * Copyright (C) 1995-1996 Gary Thomas (gdt@linuxppc.org) 9 - * 10 - * Modifications by Paul Mackerras (PowerMac) (paulus@cs.anu.edu.au) 11 - * and Cort Dougan (PReP) (cort@cs.nmt.edu) 12 - * Copyright (C) 1996 Paul Mackerras 13 - * 14 - * Derived from "arch/i386/mm/init.c" 15 - * Copyright (C) 1991, 1992, 1993, 1994 Linus Torvalds 16 - */ 17 - 18 - #include <linux/signal.h> 19 - #include <linux/sched.h> 20 - #include <linux/kernel.h> 21 - #include <linux/errno.h> 22 - #include <linux/string.h> 23 - #include <linux/types.h> 24 - #include <linux/ptrace.h> 25 - #include <linux/mman.h> 26 - #include <linux/mm.h> 27 - #include <linux/swap.h> 28 - #include <linux/stddef.h> 29 - #include <linux/vmalloc.h> 30 - #include <linux/init.h> 31 - #include <linux/delay.h> 32 - #include <linux/highmem.h> 33 - #include <linux/memblock.h> 34 - 35 - #include <asm/io.h> 36 - #include <asm/mmu_context.h> 37 - #include <asm/mmu.h> 38 - #include <linux/uaccess.h> 39 - #include <asm/smp.h> 40 - #include <asm/bootx.h> 41 - #include <asm/machdep.h> 42 - #include <asm/setup.h> 43 - 44 - #include <mm/mmu_decl.h> 45 - 46 - /* 47 - * MMU_init_hw does the chip-specific initialization of the MMU hardware. 48 - */ 49 - void __init MMU_init_hw(void) 50 - { 51 - int i; 52 - unsigned long zpr; 53 - 54 - /* 55 - * The Zone Protection Register (ZPR) defines how protection will 56 - * be applied to every page which is a member of a given zone. 57 - * The zone index bits (of ZSEL) in the PTE are used for software 58 - * indicators. We use the 4 upper bits of virtual address to select 59 - * the zone. We set all zones above TASK_SIZE to zero, allowing 60 - * only kernel access as indicated in the PTE. For zones below 61 - * TASK_SIZE, we set a 01 binary (a value of 10 will not work) 62 - * to allow user access as indicated in the PTE. This also allows 63 - * kernel access as indicated in the PTE. 64 - */ 65 - 66 - for (i = 0, zpr = 0; i < TASK_SIZE >> 28; i++) 67 - zpr |= 1 << (30 - i * 2); 68 - 69 - mtspr(SPRN_ZPR, zpr); 70 - 71 - flush_instruction_cache(); 72 - 73 - /* 74 - * Set up the real-mode cache parameters for the exception vector 75 - * handlers (which are run in real-mode). 76 - */ 77 - 78 - mtspr(SPRN_DCWR, 0x00000000); /* All caching is write-back */ 79 - 80 - /* 81 - * Cache instruction and data space where the exception 82 - * vectors and the kernel live in real-mode. 83 - */ 84 - 85 - mtspr(SPRN_DCCR, 0xFFFF0000); /* 2GByte of data space at 0x0. */ 86 - mtspr(SPRN_ICCR, 0xFFFF0000); /* 2GByte of instr. space at 0x0. */ 87 - } 88 - 89 - #define LARGE_PAGE_SIZE_16M (1<<24) 90 - #define LARGE_PAGE_SIZE_4M (1<<22) 91 - 92 - unsigned long __init mmu_mapin_ram(unsigned long base, unsigned long top) 93 - { 94 - unsigned long v, s, mapped; 95 - phys_addr_t p; 96 - 97 - v = KERNELBASE; 98 - p = 0; 99 - s = total_lowmem; 100 - 101 - if (IS_ENABLED(CONFIG_KFENCE)) 102 - return 0; 103 - 104 - if (debug_pagealloc_enabled()) 105 - return 0; 106 - 107 - if (strict_kernel_rwx_enabled()) 108 - return 0; 109 - 110 - while (s >= LARGE_PAGE_SIZE_16M) { 111 - pmd_t *pmdp; 112 - unsigned long val = p | _PMD_SIZE_16M | _PAGE_EXEC | _PAGE_RW; 113 - 114 - pmdp = pmd_off_k(v); 115 - *pmdp++ = __pmd(val); 116 - *pmdp++ = __pmd(val); 117 - *pmdp++ = __pmd(val); 118 - *pmdp++ = __pmd(val); 119 - 120 - v += LARGE_PAGE_SIZE_16M; 121 - p += LARGE_PAGE_SIZE_16M; 122 - s -= LARGE_PAGE_SIZE_16M; 123 - } 124 - 125 - while (s >= LARGE_PAGE_SIZE_4M) { 126 - pmd_t *pmdp; 127 - unsigned long val = p | _PMD_SIZE_4M | _PAGE_EXEC | _PAGE_RW; 128 - 129 - pmdp = pmd_off_k(v); 130 - *pmdp = __pmd(val); 131 - 132 - v += LARGE_PAGE_SIZE_4M; 133 - p += LARGE_PAGE_SIZE_4M; 134 - s -= LARGE_PAGE_SIZE_4M; 135 - } 136 - 137 - mapped = total_lowmem - s; 138 - 139 - /* If the size of RAM is not an exact power of two, we may not 140 - * have covered RAM in its entirety with 16 and 4 MiB 141 - * pages. Consequently, restrict the top end of RAM currently 142 - * allocable so that calls to the MEMBLOCK to allocate PTEs for "tail" 143 - * coverage with normal-sized pages (or other reasons) do not 144 - * attempt to allocate outside the allowed range. 145 - */ 146 - memblock_set_current_limit(mapped); 147 - 148 - return mapped; 149 - } 150 - 151 - void setup_initial_memory_limit(phys_addr_t first_memblock_base, 152 - phys_addr_t first_memblock_size) 153 - { 154 - /* We don't currently support the first MEMBLOCK not mapping 0 155 - * physical on those processors 156 - */ 157 - BUG_ON(first_memblock_base != 0); 158 - 159 - /* 40x can only access 16MB at the moment (see head_40x.S) */ 160 - memblock_set_current_limit(min_t(u64, first_memblock_size, 0x00800000)); 161 - }
-1
arch/powerpc/mm/nohash/Makefile
··· 2 2 3 3 obj-y += mmu_context.o tlb.o tlb_low.o kup.o 4 4 obj-$(CONFIG_PPC_BOOK3E_64) += tlb_low_64e.o book3e_pgtable.o 5 - obj-$(CONFIG_40x) += 40x.o 6 5 obj-$(CONFIG_44x) += 44x.o 7 6 obj-$(CONFIG_PPC_8xx) += 8xx.o 8 7 obj-$(CONFIG_PPC_E500) += e500.o
-2
arch/powerpc/mm/nohash/kup.c
··· 15 15 void setup_kuap(bool disabled) 16 16 { 17 17 if (disabled) { 18 - if (IS_ENABLED(CONFIG_40x)) 19 - disable_kuep = true; 20 18 if (smp_processor_id() == boot_cpuid) 21 19 cur_cpu_spec->mmu_features &= ~MMU_FTR_KUAP; 22 20 return;
+1 -4
arch/powerpc/mm/nohash/mmu_context.c
··· 219 219 /* sync */ 220 220 mb(); 221 221 } else if (kuap_is_disabled()) { 222 - if (IS_ENABLED(CONFIG_40x)) 223 - mb(); /* sync */ 224 - 225 222 mtspr(SPRN_PID, id); 226 223 isync(); 227 224 } ··· 303 306 if (IS_ENABLED(CONFIG_BDI_SWITCH)) 304 307 abatron_pteptrs[1] = next->pgd; 305 308 set_context(id, next->pgd); 306 - #if defined(CONFIG_BOOKE_OR_40x) && defined(CONFIG_PPC_KUAP) 309 + #if defined(CONFIG_BOOKE) && defined(CONFIG_PPC_KUAP) 307 310 tsk->thread.pid = id; 308 311 #endif 309 312 raw_spin_unlock(&context_lock);
+1 -26
arch/powerpc/mm/nohash/tlb_low.S
··· 32 32 #include <asm/asm-compat.h> 33 33 #include <asm/feature-fixups.h> 34 34 35 - #if defined(CONFIG_40x) 36 - 37 - /* 38 - * 40x implementation needs only tlbil_va 39 - */ 40 - _GLOBAL(__tlbil_va) 41 - /* We run the search with interrupts disabled because we have to change 42 - * the PID and I don't want to preempt when that happens. 43 - */ 44 - mfmsr r5 45 - mfspr r6,SPRN_PID 46 - wrteei 0 47 - mtspr SPRN_PID,r4 48 - tlbsx. r3, 0, r3 49 - mtspr SPRN_PID,r6 50 - wrtee r5 51 - bne 1f 52 - sync 53 - /* There are only 64 TLB entries, so r3 < 64, which means bit 25 is 54 - * clear. Since 25 is the V bit in the TLB_TAG, loading this value 55 - * will invalidate the TLB entry. */ 56 - tlbwe r3, r3, TLB_TAG 57 - isync 58 - 1: blr 59 - 60 - #elif defined(CONFIG_PPC_8xx) 35 + #if defined(CONFIG_PPC_8xx) 61 36 62 37 /* 63 38 * Nothing to do for 8xx, everything is inline
+13 -1
arch/powerpc/mm/numa.c
··· 896 896 897 897 static int __init parse_numa_properties(void) 898 898 { 899 - struct device_node *memory; 899 + struct device_node *memory, *pci; 900 900 int default_nid = 0; 901 901 unsigned long i; 902 902 const __be32 *associativity; ··· 1008 1008 1009 1009 if (--ranges) 1010 1010 goto new_range; 1011 + } 1012 + 1013 + for_each_node_by_name(pci, "pci") { 1014 + int nid = NUMA_NO_NODE; 1015 + 1016 + associativity = of_get_associativity(pci); 1017 + if (associativity) { 1018 + nid = associativity_to_nid(associativity); 1019 + initialize_form1_numa_distance(associativity); 1020 + } 1021 + if (likely(nid >= 0) && !node_online(nid)) 1022 + node_set_online(nid); 1011 1023 } 1012 1024 1013 1025 /*
+1 -1
arch/powerpc/mm/ptdump/Makefile
··· 2 2 3 3 obj-y += ptdump.o 4 4 5 - obj-$(CONFIG_4xx) += shared.o 5 + obj-$(CONFIG_44x) += shared.o 6 6 obj-$(CONFIG_PPC_8xx) += 8xx.o 7 7 obj-$(CONFIG_PPC_E500) += shared.o 8 8 obj-$(CONFIG_PPC_BOOK3S_32) += shared.o
+88 -30
arch/powerpc/net/bpf_jit_comp64.c
··· 510 510 case BPF_ALU | BPF_DIV | BPF_X: /* (u32) dst /= (u32) src */ 511 511 case BPF_ALU | BPF_MOD | BPF_X: /* (u32) dst %= (u32) src */ 512 512 if (BPF_OP(code) == BPF_MOD) { 513 - EMIT(PPC_RAW_DIVWU(tmp1_reg, dst_reg, src_reg)); 513 + if (off) 514 + EMIT(PPC_RAW_DIVW(tmp1_reg, dst_reg, src_reg)); 515 + else 516 + EMIT(PPC_RAW_DIVWU(tmp1_reg, dst_reg, src_reg)); 517 + 514 518 EMIT(PPC_RAW_MULW(tmp1_reg, src_reg, tmp1_reg)); 515 519 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg)); 516 520 } else 517 - EMIT(PPC_RAW_DIVWU(dst_reg, dst_reg, src_reg)); 521 + if (off) 522 + EMIT(PPC_RAW_DIVW(dst_reg, dst_reg, src_reg)); 523 + else 524 + EMIT(PPC_RAW_DIVWU(dst_reg, dst_reg, src_reg)); 518 525 goto bpf_alu32_trunc; 519 526 case BPF_ALU64 | BPF_DIV | BPF_X: /* dst /= src */ 520 527 case BPF_ALU64 | BPF_MOD | BPF_X: /* dst %= src */ 521 528 if (BPF_OP(code) == BPF_MOD) { 522 - EMIT(PPC_RAW_DIVDU(tmp1_reg, dst_reg, src_reg)); 529 + if (off) 530 + EMIT(PPC_RAW_DIVD(tmp1_reg, dst_reg, src_reg)); 531 + else 532 + EMIT(PPC_RAW_DIVDU(tmp1_reg, dst_reg, src_reg)); 523 533 EMIT(PPC_RAW_MULD(tmp1_reg, src_reg, tmp1_reg)); 524 534 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg)); 525 535 } else 526 - EMIT(PPC_RAW_DIVDU(dst_reg, dst_reg, src_reg)); 536 + if (off) 537 + EMIT(PPC_RAW_DIVD(dst_reg, dst_reg, src_reg)); 538 + else 539 + EMIT(PPC_RAW_DIVDU(dst_reg, dst_reg, src_reg)); 527 540 break; 528 541 case BPF_ALU | BPF_MOD | BPF_K: /* (u32) dst %= (u32) imm */ 529 542 case BPF_ALU | BPF_DIV | BPF_K: /* (u32) dst /= (u32) imm */ ··· 557 544 switch (BPF_CLASS(code)) { 558 545 case BPF_ALU: 559 546 if (BPF_OP(code) == BPF_MOD) { 560 - EMIT(PPC_RAW_DIVWU(tmp2_reg, dst_reg, tmp1_reg)); 547 + if (off) 548 + EMIT(PPC_RAW_DIVW(tmp2_reg, dst_reg, tmp1_reg)); 549 + else 550 + EMIT(PPC_RAW_DIVWU(tmp2_reg, dst_reg, tmp1_reg)); 561 551 EMIT(PPC_RAW_MULW(tmp1_reg, tmp1_reg, tmp2_reg)); 562 552 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg)); 563 553 } else 564 - EMIT(PPC_RAW_DIVWU(dst_reg, dst_reg, tmp1_reg)); 554 + if (off) 555 + EMIT(PPC_RAW_DIVW(dst_reg, dst_reg, tmp1_reg)); 556 + else 557 + EMIT(PPC_RAW_DIVWU(dst_reg, dst_reg, tmp1_reg)); 565 558 break; 566 559 case BPF_ALU64: 567 560 if (BPF_OP(code) == BPF_MOD) { 568 - EMIT(PPC_RAW_DIVDU(tmp2_reg, dst_reg, tmp1_reg)); 561 + if (off) 562 + EMIT(PPC_RAW_DIVD(tmp2_reg, dst_reg, tmp1_reg)); 563 + else 564 + EMIT(PPC_RAW_DIVDU(tmp2_reg, dst_reg, tmp1_reg)); 569 565 EMIT(PPC_RAW_MULD(tmp1_reg, tmp1_reg, tmp2_reg)); 570 566 EMIT(PPC_RAW_SUB(dst_reg, dst_reg, tmp1_reg)); 571 567 } else 572 - EMIT(PPC_RAW_DIVDU(dst_reg, dst_reg, tmp1_reg)); 568 + if (off) 569 + EMIT(PPC_RAW_DIVD(dst_reg, dst_reg, tmp1_reg)); 570 + else 571 + EMIT(PPC_RAW_DIVDU(dst_reg, dst_reg, tmp1_reg)); 573 572 break; 574 573 } 575 574 goto bpf_alu32_trunc; ··· 701 676 /* special mov32 for zext */ 702 677 EMIT(PPC_RAW_RLWINM(dst_reg, dst_reg, 0, 0, 31)); 703 678 break; 704 - } 705 - EMIT(PPC_RAW_MR(dst_reg, src_reg)); 679 + } else if (off == 8) { 680 + EMIT(PPC_RAW_EXTSB(dst_reg, src_reg)); 681 + } else if (off == 16) { 682 + EMIT(PPC_RAW_EXTSH(dst_reg, src_reg)); 683 + } else if (off == 32) { 684 + EMIT(PPC_RAW_EXTSW(dst_reg, src_reg)); 685 + } else if (dst_reg != src_reg) 686 + EMIT(PPC_RAW_MR(dst_reg, src_reg)); 706 687 goto bpf_alu32_trunc; 707 688 case BPF_ALU | BPF_MOV | BPF_K: /* (u32) dst = imm */ 708 689 case BPF_ALU64 | BPF_MOV | BPF_K: /* dst = (s64) imm */ ··· 730 699 */ 731 700 case BPF_ALU | BPF_END | BPF_FROM_LE: 732 701 case BPF_ALU | BPF_END | BPF_FROM_BE: 702 + case BPF_ALU64 | BPF_END | BPF_FROM_LE: 733 703 #ifdef __BIG_ENDIAN__ 734 704 if (BPF_SRC(code) == BPF_FROM_BE) 735 705 goto emit_clear; 736 706 #else /* !__BIG_ENDIAN__ */ 737 - if (BPF_SRC(code) == BPF_FROM_LE) 707 + if (BPF_CLASS(code) == BPF_ALU && BPF_SRC(code) == BPF_FROM_LE) 738 708 goto emit_clear; 739 709 #endif 740 710 switch (imm) { ··· 968 936 */ 969 937 /* dst = *(u8 *)(ul) (src + off) */ 970 938 case BPF_LDX | BPF_MEM | BPF_B: 939 + case BPF_LDX | BPF_MEMSX | BPF_B: 971 940 case BPF_LDX | BPF_PROBE_MEM | BPF_B: 941 + case BPF_LDX | BPF_PROBE_MEMSX | BPF_B: 972 942 /* dst = *(u16 *)(ul) (src + off) */ 973 943 case BPF_LDX | BPF_MEM | BPF_H: 944 + case BPF_LDX | BPF_MEMSX | BPF_H: 974 945 case BPF_LDX | BPF_PROBE_MEM | BPF_H: 946 + case BPF_LDX | BPF_PROBE_MEMSX | BPF_H: 975 947 /* dst = *(u32 *)(ul) (src + off) */ 976 948 case BPF_LDX | BPF_MEM | BPF_W: 949 + case BPF_LDX | BPF_MEMSX | BPF_W: 977 950 case BPF_LDX | BPF_PROBE_MEM | BPF_W: 951 + case BPF_LDX | BPF_PROBE_MEMSX | BPF_W: 978 952 /* dst = *(u64 *)(ul) (src + off) */ 979 953 case BPF_LDX | BPF_MEM | BPF_DW: 980 954 case BPF_LDX | BPF_PROBE_MEM | BPF_DW: ··· 990 952 * load only if addr is kernel address (see is_kernel_addr()), otherwise 991 953 * set dst_reg=0 and move on. 992 954 */ 993 - if (BPF_MODE(code) == BPF_PROBE_MEM) { 955 + if (BPF_MODE(code) == BPF_PROBE_MEM || BPF_MODE(code) == BPF_PROBE_MEMSX) { 994 956 EMIT(PPC_RAW_ADDI(tmp1_reg, src_reg, off)); 995 957 if (IS_ENABLED(CONFIG_PPC_BOOK3E_64)) 996 958 PPC_LI64(tmp2_reg, 0x8000000000000000ul); ··· 1003 965 * Check if 'off' is word aligned for BPF_DW, because 1004 966 * we might generate two instructions. 1005 967 */ 1006 - if (BPF_SIZE(code) == BPF_DW && (off & 3)) 968 + if ((BPF_SIZE(code) == BPF_DW || 969 + (BPF_SIZE(code) == BPF_B && BPF_MODE(code) == BPF_PROBE_MEMSX)) && 970 + (off & 3)) 1007 971 PPC_JMP((ctx->idx + 3) * 4); 1008 972 else 1009 973 PPC_JMP((ctx->idx + 2) * 4); 1010 974 } 1011 975 1012 - switch (size) { 1013 - case BPF_B: 1014 - EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off)); 1015 - break; 1016 - case BPF_H: 1017 - EMIT(PPC_RAW_LHZ(dst_reg, src_reg, off)); 1018 - break; 1019 - case BPF_W: 1020 - EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off)); 1021 - break; 1022 - case BPF_DW: 1023 - if (off % 4) { 1024 - EMIT(PPC_RAW_LI(tmp1_reg, off)); 1025 - EMIT(PPC_RAW_LDX(dst_reg, src_reg, tmp1_reg)); 1026 - } else { 1027 - EMIT(PPC_RAW_LD(dst_reg, src_reg, off)); 976 + if (BPF_MODE(code) == BPF_MEMSX || BPF_MODE(code) == BPF_PROBE_MEMSX) { 977 + switch (size) { 978 + case BPF_B: 979 + EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off)); 980 + EMIT(PPC_RAW_EXTSB(dst_reg, dst_reg)); 981 + break; 982 + case BPF_H: 983 + EMIT(PPC_RAW_LHA(dst_reg, src_reg, off)); 984 + break; 985 + case BPF_W: 986 + EMIT(PPC_RAW_LWA(dst_reg, src_reg, off)); 987 + break; 1028 988 } 1029 - break; 989 + } else { 990 + switch (size) { 991 + case BPF_B: 992 + EMIT(PPC_RAW_LBZ(dst_reg, src_reg, off)); 993 + break; 994 + case BPF_H: 995 + EMIT(PPC_RAW_LHZ(dst_reg, src_reg, off)); 996 + break; 997 + case BPF_W: 998 + EMIT(PPC_RAW_LWZ(dst_reg, src_reg, off)); 999 + break; 1000 + case BPF_DW: 1001 + if (off % 4) { 1002 + EMIT(PPC_RAW_LI(tmp1_reg, off)); 1003 + EMIT(PPC_RAW_LDX(dst_reg, src_reg, tmp1_reg)); 1004 + } else { 1005 + EMIT(PPC_RAW_LD(dst_reg, src_reg, off)); 1006 + } 1007 + break; 1008 + } 1030 1009 } 1031 1010 1032 1011 if (size != BPF_DW && insn_is_zext(&insn[i + 1])) ··· 1119 1064 */ 1120 1065 case BPF_JMP | BPF_JA: 1121 1066 PPC_JMP(addrs[i + 1 + off]); 1067 + break; 1068 + case BPF_JMP32 | BPF_JA: 1069 + PPC_JMP(addrs[i + 1 + imm]); 1122 1070 break; 1123 1071 1124 1072 case BPF_JMP | BPF_JGT | BPF_K:
+19 -26
arch/powerpc/perf/core-book3s.c
··· 266 266 static inline u32 perf_get_misc_flags(struct pt_regs *regs) 267 267 { 268 268 bool use_siar = regs_use_siar(regs); 269 - unsigned long mmcra = regs->dsisr; 270 - int marked = mmcra & MMCRA_SAMPLE_ENABLE; 269 + unsigned long siar; 270 + unsigned long addr; 271 271 272 272 if (!use_siar) 273 273 return perf_flags_from_msr(regs); 274 - 275 - /* 276 - * Check the address in SIAR to identify the 277 - * privilege levels since the SIER[MSR_HV, MSR_PR] 278 - * bits are not set for marked events in power10 279 - * DD1. 280 - */ 281 - if (marked && (ppmu->flags & PPMU_P10_DD1)) { 282 - unsigned long siar = mfspr(SPRN_SIAR); 283 - if (siar) { 284 - if (is_kernel_addr(siar)) 285 - return PERF_RECORD_MISC_KERNEL; 286 - return PERF_RECORD_MISC_USER; 287 - } else { 288 - if (is_kernel_addr(regs->nip)) 289 - return PERF_RECORD_MISC_KERNEL; 290 - return PERF_RECORD_MISC_USER; 291 - } 292 - } 293 274 294 275 /* 295 276 * If we don't have flags in MMCRA, rather than using ··· 279 298 * results 280 299 */ 281 300 if (ppmu->flags & PPMU_NO_SIPR) { 282 - unsigned long siar = mfspr(SPRN_SIAR); 301 + siar = mfspr(SPRN_SIAR); 283 302 if (is_kernel_addr(siar)) 284 303 return PERF_RECORD_MISC_KERNEL; 285 304 return PERF_RECORD_MISC_USER; 286 305 } 287 306 288 307 /* PR has priority over HV, so order below is important */ 289 - if (regs_sipr(regs)) 290 - return PERF_RECORD_MISC_USER; 291 - 292 - if (regs_sihv(regs) && (freeze_events_kernel != MMCR0_FCHV)) 308 + if (regs_sipr(regs)) { 309 + if (!(ppmu->flags & PPMU_P10)) 310 + return PERF_RECORD_MISC_USER; 311 + } else if (regs_sihv(regs) && (freeze_events_kernel != MMCR0_FCHV)) 293 312 return PERF_RECORD_MISC_HYPERVISOR; 313 + 314 + /* 315 + * Check the address in SIAR to identify the 316 + * privilege levels since the SIER[MSR_HV, MSR_PR] 317 + * bits are not set correctly in power10 sometimes 318 + */ 319 + if (ppmu->flags & PPMU_P10) { 320 + siar = mfspr(SPRN_SIAR); 321 + addr = siar ? siar : regs->nip; 322 + if (!is_kernel_addr(addr)) 323 + return PERF_RECORD_MISC_USER; 324 + } 294 325 295 326 return PERF_RECORD_MISC_KERNEL; 296 327 }
+2 -1
arch/powerpc/perf/power10-pmu.c
··· 593 593 .get_mem_weight = isa207_get_mem_weight, 594 594 .disable_pmc = isa207_disable_pmc, 595 595 .flags = PPMU_HAS_SIER | PPMU_ARCH_207S | 596 - PPMU_ARCH_31 | PPMU_HAS_ATTR_CONFIG1, 596 + PPMU_ARCH_31 | PPMU_HAS_ATTR_CONFIG1 | 597 + PPMU_P10, 597 598 .n_generic = ARRAY_SIZE(power10_generic_events), 598 599 .generic_events = power10_generic_events, 599 600 .cache_events = &power10_cache_events,
-78
arch/powerpc/platforms/40x/Kconfig
··· 1 - # SPDX-License-Identifier: GPL-2.0 2 - config ACADIA 3 - bool "Acadia" 4 - depends on 40x 5 - select PPC40x_SIMPLE 6 - select 405EZ 7 - help 8 - This option enables support for the AMCC 405EZ Acadia evaluation board. 9 - 10 - config HOTFOOT 11 - bool "Hotfoot" 12 - depends on 40x 13 - select PPC40x_SIMPLE 14 - select FORCE_PCI 15 - help 16 - This option enables support for the ESTEEM 195E Hotfoot board. 17 - 18 - config KILAUEA 19 - bool "Kilauea" 20 - depends on 40x 21 - select 405EX 22 - select PPC40x_SIMPLE 23 - select PPC4xx_PCI_EXPRESS 24 - select FORCE_PCI 25 - select PCI_MSI 26 - help 27 - This option enables support for the AMCC PPC405EX evaluation board. 28 - 29 - config MAKALU 30 - bool "Makalu" 31 - depends on 40x 32 - select 405EX 33 - select FORCE_PCI 34 - select PPC4xx_PCI_EXPRESS 35 - select PPC40x_SIMPLE 36 - help 37 - This option enables support for the AMCC PPC405EX board. 38 - 39 - config OBS600 40 - bool "OpenBlockS 600" 41 - depends on 40x 42 - select 405EX 43 - select PPC40x_SIMPLE 44 - help 45 - This option enables support for PlatHome OpenBlockS 600 server 46 - 47 - config PPC40x_SIMPLE 48 - bool "Simple PowerPC 40x board support" 49 - depends on 40x 50 - help 51 - This option enables the simple PowerPC 40x platform support. 52 - 53 - config 405EX 54 - bool 55 - select IBM_EMAC_EMAC4 if IBM_EMAC 56 - select IBM_EMAC_RGMII if IBM_EMAC 57 - 58 - config 405EZ 59 - bool 60 - select IBM_EMAC_NO_FLOW_CTRL if IBM_EMAC 61 - select IBM_EMAC_MAL_CLR_ICINTSTAT if IBM_EMAC 62 - select IBM_EMAC_MAL_COMMON_ERR if IBM_EMAC 63 - 64 - config PPC4xx_GPIO 65 - bool "PPC4xx GPIO support" 66 - depends on 40x 67 - select GPIOLIB 68 - select OF_GPIO_MM_GPIOCHIP 69 - help 70 - Enable gpiolib support for ppc40x based boards 71 - 72 - config APM8018X 73 - bool "APM8018X" 74 - depends on 40x 75 - select PPC40x_SIMPLE 76 - help 77 - This option enables support for the AppliedMicro APM8018X evaluation 78 - board.
-2
arch/powerpc/platforms/40x/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - obj-$(CONFIG_PPC40x_SIMPLE) += ppc40x_simple.o
-74
arch/powerpc/platforms/40x/ppc40x_simple.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-only 2 - /* 3 - * Generic PowerPC 40x platform support 4 - * 5 - * Copyright 2008 IBM Corporation 6 - * 7 - * This implements simple platform support for PowerPC 44x chips. This is 8 - * mostly used for eval boards or other simple and "generic" 44x boards. If 9 - * your board has custom functions or hardware, then you will likely want to 10 - * implement your own board.c file to accommodate it. 11 - */ 12 - 13 - #include <asm/machdep.h> 14 - #include <asm/pci-bridge.h> 15 - #include <asm/ppc4xx.h> 16 - #include <asm/time.h> 17 - #include <asm/udbg.h> 18 - #include <asm/uic.h> 19 - 20 - #include <linux/init.h> 21 - #include <linux/of_platform.h> 22 - 23 - static const struct of_device_id ppc40x_of_bus[] __initconst = { 24 - { .compatible = "ibm,plb3", }, 25 - { .compatible = "ibm,plb4", }, 26 - { .compatible = "ibm,opb", }, 27 - { .compatible = "ibm,ebc", }, 28 - { .compatible = "simple-bus", }, 29 - {}, 30 - }; 31 - 32 - static int __init ppc40x_device_probe(void) 33 - { 34 - of_platform_bus_probe(NULL, ppc40x_of_bus, NULL); 35 - 36 - return 0; 37 - } 38 - machine_device_initcall(ppc40x_simple, ppc40x_device_probe); 39 - 40 - /* This is the list of boards that can be supported by this simple 41 - * platform code. This does _not_ mean the boards are compatible, 42 - * as they most certainly are not from a device tree perspective. 43 - * However, their differences are handled by the device tree and the 44 - * drivers and therefore they don't need custom board support files. 45 - * 46 - * Again, if your board needs to do things differently then create a 47 - * board.c file for it rather than adding it to this list. 48 - */ 49 - static const char * const board[] __initconst = { 50 - "amcc,acadia", 51 - "amcc,haleakala", 52 - "amcc,kilauea", 53 - "amcc,makalu", 54 - "apm,klondike", 55 - "est,hotfoot", 56 - "plathome,obs600", 57 - NULL 58 - }; 59 - 60 - static int __init ppc40x_probe(void) 61 - { 62 - pci_set_flags(PCI_REASSIGN_ALL_RSRC); 63 - return 1; 64 - } 65 - 66 - define_machine(ppc40x_simple) { 67 - .name = "PowerPC 40x Platform", 68 - .compatibles = board, 69 - .probe = ppc40x_probe, 70 - .progress = udbg_progress, 71 - .init_IRQ = uic_init_tree, 72 - .get_irq = uic_get_irq, 73 - .restart = ppc4xx_reset_system, 74 - };
+5 -1
arch/powerpc/platforms/44x/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 - obj-y += misc_44x.o machine_check.o 2 + obj-y += misc_44x.o machine_check.o uic.o soc.o 3 3 ifneq ($(CONFIG_PPC4xx_CPM),y) 4 4 obj-y += idle.o 5 5 endif ··· 12 12 obj-$(CONFIG_CURRITUCK) += ppc476.o 13 13 obj-$(CONFIG_AKEBONO) += ppc476.o 14 14 obj-$(CONFIG_FSP2) += fsp2.o 15 + obj-$(CONFIG_PCI) += pci.o 16 + obj-$(CONFIG_PPC4xx_HSTA_MSI) += hsta_msi.o 17 + obj-$(CONFIG_PPC4xx_CPM) += cpm.o 18 + obj-$(CONFIG_PPC4xx_GPIO) += gpio.o
+15
arch/powerpc/platforms/44x/machine_check.c
··· 9 9 #include <asm/reg.h> 10 10 #include <asm/cacheflush.h> 11 11 12 + int machine_check_4xx(struct pt_regs *regs) 13 + { 14 + unsigned long reason = regs->esr; 15 + 16 + if (reason & ESR_IMCP) { 17 + printk("Instruction"); 18 + mtspr(SPRN_ESR, reason & ~ESR_IMCP); 19 + } else 20 + printk("Data"); 21 + 22 + printk(" machine check in kernel mode.\n"); 23 + 24 + return 0; 25 + } 26 + 12 27 int machine_check_440A(struct pt_regs *regs) 13 28 { 14 29 unsigned long reason = regs->esr;
-7
arch/powerpc/platforms/4xx/Makefile
··· 1 - # SPDX-License-Identifier: GPL-2.0-only 2 - obj-y += uic.o machine_check.o 3 - obj-$(CONFIG_4xx_SOC) += soc.o 4 - obj-$(CONFIG_PCI) += pci.o 5 - obj-$(CONFIG_PPC4xx_HSTA_MSI) += hsta_msi.o 6 - obj-$(CONFIG_PPC4xx_CPM) += cpm.o 7 - obj-$(CONFIG_PPC4xx_GPIO) += gpio.o
arch/powerpc/platforms/4xx/cpm.c arch/powerpc/platforms/44x/cpm.c
arch/powerpc/platforms/4xx/gpio.c arch/powerpc/platforms/44x/gpio.c
arch/powerpc/platforms/4xx/hsta_msi.c arch/powerpc/platforms/44x/hsta_msi.c
-23
arch/powerpc/platforms/4xx/machine_check.c
··· 1 - // SPDX-License-Identifier: GPL-2.0-or-later 2 - /* 3 - */ 4 - 5 - #include <linux/kernel.h> 6 - #include <linux/printk.h> 7 - #include <linux/ptrace.h> 8 - 9 - #include <asm/reg.h> 10 - 11 - int machine_check_4xx(struct pt_regs *regs) 12 - { 13 - unsigned long reason = regs->esr; 14 - 15 - if (reason & ESR_IMCP) { 16 - printk("Instruction"); 17 - mtspr(SPRN_ESR, reason & ~ESR_IMCP); 18 - } else 19 - printk("Data"); 20 - printk(" machine check in kernel mode.\n"); 21 - 22 - return 0; 23 - }
-100
arch/powerpc/platforms/4xx/pci.c arch/powerpc/platforms/44x/pci.c
··· 1263 1263 1264 1264 #endif /* CONFIG_44x */ 1265 1265 1266 - #ifdef CONFIG_40x 1267 - 1268 - static int __init ppc405ex_pciex_core_init(struct device_node *np) 1269 - { 1270 - /* Nothing to do, return 2 ports */ 1271 - return 2; 1272 - } 1273 - 1274 - static void __init ppc405ex_pcie_phy_reset(struct ppc4xx_pciex_port *port) 1275 - { 1276 - /* Assert the PE0_PHY reset */ 1277 - mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01010000); 1278 - msleep(1); 1279 - 1280 - /* deassert the PE0_hotreset */ 1281 - if (port->endpoint) 1282 - mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01111000); 1283 - else 1284 - mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x01101000); 1285 - 1286 - /* poll for phy !reset */ 1287 - /* XXX FIXME add timeout */ 1288 - while (!(mfdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSTA) & 0x00001000)) 1289 - ; 1290 - 1291 - /* deassert the PE0_gpl_utl_reset */ 1292 - mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET, 0x00101000); 1293 - } 1294 - 1295 - static int __init ppc405ex_pciex_init_port_hw(struct ppc4xx_pciex_port *port) 1296 - { 1297 - u32 val; 1298 - 1299 - if (port->endpoint) 1300 - val = PTYPE_LEGACY_ENDPOINT; 1301 - else 1302 - val = PTYPE_ROOT_PORT; 1303 - 1304 - mtdcri(SDR0, port->sdr_base + PESDRn_DLPSET, 1305 - 1 << 24 | val << 20 | LNKW_X1 << 12); 1306 - 1307 - mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET1, 0x00000000); 1308 - mtdcri(SDR0, port->sdr_base + PESDRn_UTLSET2, 0x01010000); 1309 - mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET1, 0x720F0000); 1310 - mtdcri(SDR0, port->sdr_base + PESDRn_405EX_PHYSET2, 0x70600003); 1311 - 1312 - /* 1313 - * Only reset the PHY when no link is currently established. 1314 - * This is for the Atheros PCIe board which has problems to establish 1315 - * the link (again) after this PHY reset. All other currently tested 1316 - * PCIe boards don't show this problem. 1317 - * This has to be re-tested and fixed in a later release! 1318 - */ 1319 - val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP); 1320 - if (!(val & 0x00001000)) 1321 - ppc405ex_pcie_phy_reset(port); 1322 - 1323 - dcr_write(port->dcrs, DCRO_PEGPL_CFG, 0x10000000); /* guarded on */ 1324 - 1325 - port->has_ibpre = 1; 1326 - 1327 - return ppc4xx_pciex_port_reset_sdr(port); 1328 - } 1329 - 1330 - static int ppc405ex_pciex_init_utl(struct ppc4xx_pciex_port *port) 1331 - { 1332 - dcr_write(port->dcrs, DCRO_PEGPL_SPECIAL, 0x0); 1333 - 1334 - /* 1335 - * Set buffer allocations and then assert VRB and TXE. 1336 - */ 1337 - out_be32(port->utl_base + PEUTL_OUTTR, 0x02000000); 1338 - out_be32(port->utl_base + PEUTL_INTR, 0x02000000); 1339 - out_be32(port->utl_base + PEUTL_OPDBSZ, 0x04000000); 1340 - out_be32(port->utl_base + PEUTL_PBBSZ, 0x21000000); 1341 - out_be32(port->utl_base + PEUTL_IPHBSZ, 0x02000000); 1342 - out_be32(port->utl_base + PEUTL_IPDBSZ, 0x04000000); 1343 - out_be32(port->utl_base + PEUTL_RCIRQEN, 0x00f00000); 1344 - out_be32(port->utl_base + PEUTL_PCTL, 0x80800066); 1345 - 1346 - out_be32(port->utl_base + PEUTL_PBCTL, 0x08000000); 1347 - 1348 - return 0; 1349 - } 1350 - 1351 - static struct ppc4xx_pciex_hwops ppc405ex_pcie_hwops __initdata = 1352 - { 1353 - .want_sdr = true, 1354 - .core_init = ppc405ex_pciex_core_init, 1355 - .port_init_hw = ppc405ex_pciex_init_port_hw, 1356 - .setup_utl = ppc405ex_pciex_init_utl, 1357 - .check_link = ppc4xx_pciex_check_link_sdr, 1358 - }; 1359 - 1360 - #endif /* CONFIG_40x */ 1361 - 1362 1266 #ifdef CONFIG_476FPE 1363 1267 static int __init ppc_476fpe_pciex_core_init(struct device_node *np) 1364 1268 { ··· 1331 1427 if (of_device_is_compatible(np, "ibm,plb-pciex-apm821xx")) 1332 1428 ppc4xx_pciex_hwops = &apm821xx_pcie_hwops; 1333 1429 #endif /* CONFIG_44x */ 1334 - #ifdef CONFIG_40x 1335 - if (of_device_is_compatible(np, "ibm,plb-pciex-405ex")) 1336 - ppc4xx_pciex_hwops = &ppc405ex_pcie_hwops; 1337 - #endif 1338 1430 #ifdef CONFIG_476FPE 1339 1431 if (of_device_is_compatible(np, "ibm,plb-pciex-476fpe") 1340 1432 || of_device_is_compatible(np, "ibm,plb-pciex-476gtr"))
arch/powerpc/platforms/4xx/pci.h arch/powerpc/platforms/44x/pci.h
arch/powerpc/platforms/4xx/soc.c arch/powerpc/platforms/44x/soc.c
arch/powerpc/platforms/4xx/uic.c arch/powerpc/platforms/44x/uic.c
+1
arch/powerpc/platforms/85xx/t1042rdb_diu.c
··· 149 149 150 150 early_initcall(t1042rdb_diu_init); 151 151 152 + MODULE_DESCRIPTION("Freescale T1042 DIU driver"); 152 153 MODULE_LICENSE("GPL");
-1
arch/powerpc/platforms/Kconfig
··· 18 18 source "arch/powerpc/platforms/86xx/Kconfig" 19 19 source "arch/powerpc/platforms/embedded6xx/Kconfig" 20 20 source "arch/powerpc/platforms/44x/Kconfig" 21 - source "arch/powerpc/platforms/40x/Kconfig" 22 21 source "arch/powerpc/platforms/amigaone/Kconfig" 23 22 source "arch/powerpc/platforms/book3s/Kconfig" 24 23 source "arch/powerpc/platforms/microwatt/Kconfig"
+4 -24
arch/powerpc/platforms/Kconfig.cputype
··· 43 43 select HAVE_ARCH_VMAP_STACK 44 44 select HUGETLBFS 45 45 46 - config 40x 47 - bool "AMCC 40x" 48 - select PPC_DCR_NATIVE 49 - select PPC_UDBG_16550 50 - select 4xx_SOC 51 - select HAVE_PCI 52 - select PPC_KUEP if PPC_KUAP 53 - 54 46 config 44x 55 47 bool "AMCC 44x, 46x or 47x" 56 48 select PPC_DCR_NATIVE 57 49 select PPC_UDBG_16550 58 - select 4xx_SOC 59 50 select HAVE_PCI 60 51 select PHYS_64BIT 61 52 select PPC_KUEP ··· 185 194 depends on !CC_IS_CLANG 186 195 select PPC_HAS_LBARX_LHARX 187 196 188 - config 405_CPU 189 - bool "40x family" 190 - depends on 40x 191 - depends on !CC_IS_CLANG 192 - 193 197 config 440_CPU 194 198 bool "440 (44x family)" 195 199 depends on 44x ··· 250 264 default "e6500" if E6500_CPU 251 265 default "power4" if POWERPC64_CPU && !CPU_LITTLE_ENDIAN 252 266 default "power8" if POWERPC64_CPU && CPU_LITTLE_ENDIAN 253 - default "405" if 405_CPU 254 267 default "440" if 440_CPU 255 268 default "464" if 464_CPU 256 269 default "476" if 476_CPU ··· 325 340 326 341 config 4xx 327 342 bool 328 - depends on 40x || 44x 343 + depends on 44x 329 344 default y 330 345 331 346 config BOOKE 332 347 bool 333 348 depends on PPC_E500 || 44x 334 - default y 335 - 336 - config BOOKE_OR_40x 337 - bool 338 - depends on BOOKE || 40x 339 349 default y 340 350 341 351 config PTE_64BIT ··· 475 495 This option builds the kernel with the pc relative ABI model. 476 496 477 497 config PPC_KUEP 478 - bool "Kernel Userspace Execution Prevention" if !40x 479 - default y if !40x 498 + bool "Kernel Userspace Execution Prevention" 499 + default y 480 500 help 481 501 Enable support for Kernel Userspace Execution Prevention (KUEP) 482 502 ··· 562 582 563 583 config NOT_COHERENT_CACHE 564 584 bool 565 - depends on 4xx || PPC_8xx || PPC_MPC512x || \ 585 + depends on 44x || PPC_8xx || PPC_MPC512x || \ 566 586 GAMECUBE_COMMON || AMIGAONE 567 587 select ARCH_HAS_DMA_PREP_COHERENT 568 588 select ARCH_HAS_SYNC_DMA_FOR_DEVICE
-2
arch/powerpc/platforms/Makefile
··· 4 4 5 5 obj-$(CONFIG_PPC_PMAC) += powermac/ 6 6 obj-$(CONFIG_PPC_CHRP) += chrp/ 7 - obj-$(CONFIG_4xx) += 4xx/ 8 - obj-$(CONFIG_40x) += 40x/ 9 7 obj-$(CONFIG_44x) += 44x/ 10 8 obj-$(CONFIG_PPC_MPC512x) += 512x/ 11 9 obj-$(CONFIG_PPC_MPC52xx) += 52xx/
+1
arch/powerpc/platforms/cell/cbe_powerbutton.c
··· 101 101 module_init(cbe_powerbutton_init); 102 102 module_exit(cbe_powerbutton_exit); 103 103 104 + MODULE_DESCRIPTION("Driver for powerbutton on IBM cell blades"); 104 105 MODULE_LICENSE("GPL"); 105 106 MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");
+1
arch/powerpc/platforms/cell/cbe_thermal.c
··· 381 381 } 382 382 module_exit(thermal_exit); 383 383 384 + MODULE_DESCRIPTION("Cell processor thermal driver"); 384 385 MODULE_LICENSE("GPL"); 385 386 MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>"); 386 387
+1
arch/powerpc/platforms/cell/cpufreq_spudemand.c
··· 129 129 cpufreq_governor_init(spu_governor); 130 130 cpufreq_governor_exit(spu_governor); 131 131 132 + MODULE_DESCRIPTION("SPU-aware cpufreq governor for the cell processor"); 132 133 MODULE_LICENSE("GPL"); 133 134 MODULE_AUTHOR("Christian Krafft <krafft@de.ibm.com>");
+1
arch/powerpc/platforms/cell/spufs/inode.c
··· 822 822 } 823 823 module_exit(spufs_exit); 824 824 825 + MODULE_DESCRIPTION("SPU file system"); 825 826 MODULE_LICENSE("GPL"); 826 827 MODULE_AUTHOR("Arnd Bergmann <arndb@de.ibm.com>"); 827 828
+1
arch/powerpc/platforms/chrp/nvram.c
··· 92 92 return; 93 93 } 94 94 95 + MODULE_DESCRIPTION("PPC NVRAM device driver"); 95 96 MODULE_LICENSE("GPL v2");
+4 -2
arch/powerpc/platforms/powernv/pci-ioda.c
··· 1537 1537 } 1538 1538 } 1539 1539 1540 - static long pnv_ioda2_take_ownership(struct iommu_table_group *table_group) 1540 + static long pnv_ioda2_take_ownership(struct iommu_table_group *table_group, 1541 + struct device *dev __maybe_unused) 1541 1542 { 1542 1543 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe, 1543 1544 table_group); ··· 1563 1562 return 0; 1564 1563 } 1565 1564 1566 - static void pnv_ioda2_release_ownership(struct iommu_table_group *table_group) 1565 + static void pnv_ioda2_release_ownership(struct iommu_table_group *table_group, 1566 + struct device *dev __maybe_unused) 1567 1567 { 1568 1568 struct pnv_ioda_pe *pe = container_of(table_group, struct pnv_ioda_pe, 1569 1569 table_group);
+733 -48
arch/powerpc/platforms/pseries/iommu.c
··· 21 21 #include <linux/dma-mapping.h> 22 22 #include <linux/crash_dump.h> 23 23 #include <linux/memory.h> 24 + #include <linux/vmalloc.h> 24 25 #include <linux/of.h> 25 26 #include <linux/of_address.h> 26 27 #include <linux/iommu.h> ··· 68 67 return tbl; 69 68 } 70 69 70 + #ifdef CONFIG_IOMMU_API 71 + static struct iommu_table_group_ops spapr_tce_table_group_ops; 72 + #endif 73 + 71 74 static struct iommu_table_group *iommu_pseries_alloc_group(int node) 72 75 { 73 76 struct iommu_table_group *table_group; ··· 107 102 #endif 108 103 109 104 /* Default DMA window table is at index 0, while DDW at 1. SR-IOV 110 - * adapters only have table on index 1. 105 + * adapters only have table on index 0(if not direct mapped). 111 106 */ 112 107 if (table_group->tables[0]) 113 108 iommu_tce_table_put(table_group->tables[0]); ··· 148 143 } 149 144 150 145 151 - static void tce_free_pSeries(struct iommu_table *tbl, long index, long npages) 146 + static void tce_clear_pSeries(struct iommu_table *tbl, long index, long npages) 152 147 { 153 148 __be64 *tcep; 154 149 ··· 165 160 tcep = ((__be64 *)tbl->it_base) + index; 166 161 167 162 return be64_to_cpu(*tcep); 163 + } 164 + 165 + #ifdef CONFIG_IOMMU_API 166 + static long pseries_tce_iommu_userspace_view_alloc(struct iommu_table *tbl) 167 + { 168 + unsigned long cb = ALIGN(sizeof(tbl->it_userspace[0]) * tbl->it_size, PAGE_SIZE); 169 + unsigned long *uas; 170 + 171 + if (tbl->it_indirect_levels) /* Impossible */ 172 + return -EPERM; 173 + 174 + WARN_ON(tbl->it_userspace); 175 + 176 + uas = vzalloc(cb); 177 + if (!uas) 178 + return -ENOMEM; 179 + 180 + tbl->it_userspace = (__be64 *) uas; 181 + 182 + return 0; 183 + } 184 + #endif 185 + 186 + static void tce_iommu_userspace_view_free(struct iommu_table *tbl) 187 + { 188 + vfree(tbl->it_userspace); 189 + tbl->it_userspace = NULL; 190 + } 191 + 192 + static void tce_free_pSeries(struct iommu_table *tbl) 193 + { 194 + if (!tbl->it_userspace) 195 + tce_iommu_userspace_view_free(tbl); 168 196 } 169 197 170 198 static void tce_free_pSeriesLP(unsigned long liobn, long, long, long); ··· 614 576 615 577 struct iommu_table_ops iommu_table_pseries_ops = { 616 578 .set = tce_build_pSeries, 617 - .clear = tce_free_pSeries, 579 + .clear = tce_clear_pSeries, 618 580 .get = tce_get_pseries 619 581 }; 620 582 ··· 723 685 724 686 return rc; 725 687 } 688 + 689 + static __be64 *tce_useraddr_pSeriesLP(struct iommu_table *tbl, long index, 690 + bool __always_unused alloc) 691 + { 692 + return tbl->it_userspace ? &tbl->it_userspace[index - tbl->it_offset] : NULL; 693 + } 726 694 #endif 727 695 728 696 struct iommu_table_ops iommu_table_lpar_multi_ops = { 729 697 .set = tce_buildmulti_pSeriesLP, 730 698 #ifdef CONFIG_IOMMU_API 731 699 .xchg_no_kill = tce_exchange_pseries, 700 + .useraddrptr = tce_useraddr_pSeriesLP, 732 701 #endif 733 702 .clear = tce_freemulti_pSeriesLP, 734 - .get = tce_get_pSeriesLP 703 + .get = tce_get_pSeriesLP, 704 + .free = tce_free_pSeries 735 705 }; 706 + 707 + #ifdef CONFIG_IOMMU_API 708 + /* 709 + * When the DMA window properties might have been removed, 710 + * the parent node has the table_group setup on it. 711 + */ 712 + static struct device_node *pci_dma_find_parent_node(struct pci_dev *dev, 713 + struct iommu_table_group *table_group) 714 + { 715 + struct device_node *dn = pci_device_to_OF_node(dev); 716 + struct pci_dn *rpdn; 717 + 718 + for (; dn && PCI_DN(dn); dn = dn->parent) { 719 + rpdn = PCI_DN(dn); 720 + 721 + if (table_group == rpdn->table_group) 722 + return dn; 723 + } 724 + 725 + return NULL; 726 + } 727 + #endif 736 728 737 729 /* 738 730 * Find nearest ibm,dma-window (default DMA window) or direct DMA window or ··· 880 812 be32_to_cpu(prop.tce_shift), NULL, 881 813 &iommu_table_lpar_multi_ops); 882 814 883 - /* Only for normal boot with default window. Doesn't matter even 884 - * if we set these with DDW which is 64bit during kdump, since 885 - * these will not be used during kdump. 886 - */ 887 - ppci->table_group->tce32_start = be64_to_cpu(prop.dma_base); 888 - ppci->table_group->tce32_size = 1 << be32_to_cpu(prop.window_shift); 889 - 890 815 if (!iommu_init_table(tbl, ppci->phb->node, 0, 0)) 891 816 panic("Failed to initialize iommu table"); 892 817 ··· 978 917 } 979 918 980 919 static void remove_dma_window(struct device_node *np, u32 *ddw_avail, 981 - struct property *win) 920 + struct property *win, bool cleanup) 982 921 { 983 922 struct dynamic_dma_window_prop *dwp; 984 923 u64 liobn; ··· 986 925 dwp = win->value; 987 926 liobn = (u64)be32_to_cpu(dwp->liobn); 988 927 989 - clean_dma_window(np, dwp); 928 + if (cleanup) 929 + clean_dma_window(np, dwp); 990 930 __remove_dma_window(np, ddw_avail, liobn); 991 931 } 992 932 993 - static int remove_ddw(struct device_node *np, bool remove_prop, const char *win_name) 933 + static void copy_property(struct device_node *pdn, const char *from, const char *to) 934 + { 935 + struct property *src, *dst; 936 + 937 + src = of_find_property(pdn, from, NULL); 938 + if (!src) 939 + return; 940 + 941 + dst = kzalloc(sizeof(*dst), GFP_KERNEL); 942 + if (!dst) 943 + return; 944 + 945 + dst->name = kstrdup(to, GFP_KERNEL); 946 + dst->value = kmemdup(src->value, src->length, GFP_KERNEL); 947 + dst->length = src->length; 948 + if (!dst->name || !dst->value) 949 + return; 950 + 951 + if (of_add_property(pdn, dst)) { 952 + pr_err("Unable to add DMA window property for %pOF", pdn); 953 + goto free_prop; 954 + } 955 + 956 + return; 957 + 958 + free_prop: 959 + kfree(dst->name); 960 + kfree(dst->value); 961 + kfree(dst); 962 + } 963 + 964 + static int remove_dma_window_named(struct device_node *np, bool remove_prop, const char *win_name, 965 + bool cleanup) 994 966 { 995 967 struct property *win; 996 968 u32 ddw_avail[DDW_APPLICABLE_SIZE]; ··· 1038 944 if (ret) 1039 945 return 0; 1040 946 1041 - 1042 947 if (win->length >= sizeof(struct dynamic_dma_window_prop)) 1043 - remove_dma_window(np, ddw_avail, win); 948 + remove_dma_window(np, ddw_avail, win, cleanup); 1044 949 1045 950 if (!remove_prop) 1046 951 return 0; 952 + 953 + /* Default window property if removed is lost as reset-pe doesn't restore it. 954 + * Though FDT has a copy of it, the DLPAR hotplugged devices will not have a 955 + * node on FDT until next reboot. So, back it up. 956 + */ 957 + if ((strcmp(win_name, "ibm,dma-window") == 0) && 958 + !of_find_property(np, "ibm,dma-window-saved", NULL)) 959 + copy_property(np, win_name, "ibm,dma-window-saved"); 1047 960 1048 961 ret = of_remove_property(np, win); 1049 962 if (ret) ··· 1109 1008 for_each_node_with_property(pdn, name) { 1110 1009 dma64 = of_get_property(pdn, name, &len); 1111 1010 if (!dma64 || len < sizeof(*dma64)) { 1112 - remove_ddw(pdn, true, name); 1011 + remove_dma_window_named(pdn, true, name, true); 1113 1012 continue; 1114 1013 } 1115 1014 ··· 1405 1304 struct ddw_query_response query; 1406 1305 struct ddw_create_response create; 1407 1306 int page_shift; 1408 - u64 win_addr; 1307 + u64 win_addr, dynamic_offset = 0; 1409 1308 const char *win_name; 1410 1309 struct device_node *dn; 1411 1310 u32 ddw_avail[DDW_APPLICABLE_SIZE]; ··· 1413 1312 struct property *win64; 1414 1313 struct failed_ddw_pdn *fpdn; 1415 1314 bool default_win_removed = false, direct_mapping = false; 1315 + bool dynamic_mapping = false; 1416 1316 bool pmem_present; 1417 1317 struct pci_dn *pci = PCI_DN(pdn); 1418 1318 struct property *default_win = NULL; ··· 1487 1385 if (reset_win_ext) 1488 1386 goto out_failed; 1489 1387 1490 - remove_dma_window(pdn, ddw_avail, default_win); 1388 + remove_dma_window(pdn, ddw_avail, default_win, true); 1491 1389 default_win_removed = true; 1492 1390 1493 1391 /* Query again, to check if the window is available */ ··· 1508 1406 query.page_size); 1509 1407 goto out_failed; 1510 1408 } 1511 - 1512 1409 1513 1410 /* 1514 1411 * The "ibm,pmemory" can appear anywhere in the address space. ··· 1533 1432 1ULL << page_shift); 1534 1433 1535 1434 len = order_base_2(query.largest_available_block << page_shift); 1536 - win_name = DMA64_PROPNAME; 1435 + 1436 + dynamic_mapping = true; 1537 1437 } else { 1538 1438 direct_mapping = !default_win_removed || 1539 1439 (len == MAX_PHYSMEM_BITS) || 1540 1440 (!pmem_present && (len == max_ram_len)); 1541 - win_name = direct_mapping ? DIRECT64_PROPNAME : DMA64_PROPNAME; 1441 + 1442 + /* DDW is big enough to direct map RAM. If there is vPMEM, check 1443 + * if enough space is left in DDW where we can dynamically 1444 + * allocate TCEs for vPMEM. For now, this Hybrid sharing of DDW 1445 + * is only for SR-IOV devices. 1446 + */ 1447 + if (default_win_removed && pmem_present && !direct_mapping) { 1448 + /* DDW is big enough to be split */ 1449 + if ((query.largest_available_block << page_shift) >= 1450 + MIN_DDW_VPMEM_DMA_WINDOW + (1ULL << max_ram_len)) { 1451 + direct_mapping = true; 1452 + 1453 + /* offset of the Dynamic part of DDW */ 1454 + dynamic_offset = 1ULL << max_ram_len; 1455 + } 1456 + 1457 + /* DDW will at least have dynamic allocation */ 1458 + dynamic_mapping = true; 1459 + 1460 + /* create max size DDW possible */ 1461 + len = order_base_2(query.largest_available_block 1462 + << page_shift); 1463 + } 1542 1464 } 1465 + 1466 + /* Even if the DDW is split into both direct mapped RAM and dynamically 1467 + * mapped vPMEM, the DDW property in OF will be marked as Direct. 1468 + */ 1469 + win_name = direct_mapping ? DIRECT64_PROPNAME : DMA64_PROPNAME; 1543 1470 1544 1471 ret = create_ddw(dev, ddw_avail, &create, page_shift, len); 1545 1472 if (ret != 0) ··· 1596 1467 if (!window) 1597 1468 goto out_del_prop; 1598 1469 1599 - if (direct_mapping) { 1600 - window->direct = true; 1470 + window->direct = direct_mapping; 1601 1471 1472 + if (direct_mapping) { 1602 1473 /* DDW maps the whole partition, so enable direct DMA mapping */ 1603 1474 ret = walk_system_ram_range(0, memblock_end_of_DRAM() >> PAGE_SHIFT, 1604 1475 win64->value, tce_setrange_multi_pSeriesLP_walk); ··· 1610 1481 clean_dma_window(pdn, win64->value); 1611 1482 goto out_del_list; 1612 1483 } 1613 - } else { 1484 + if (default_win_removed) { 1485 + iommu_tce_table_put(pci->table_group->tables[0]); 1486 + pci->table_group->tables[0] = NULL; 1487 + set_iommu_table_base(&dev->dev, NULL); 1488 + } 1489 + } 1490 + 1491 + if (dynamic_mapping) { 1614 1492 struct iommu_table *newtbl; 1615 1493 int i; 1616 1494 unsigned long start = 0, end = 0; 1617 - 1618 - window->direct = false; 1495 + u64 dynamic_addr, dynamic_len; 1619 1496 1620 1497 for (i = 0; i < ARRAY_SIZE(pci->phb->mem_resources); i++) { 1621 1498 const unsigned long mask = IORESOURCE_MEM_64 | IORESOURCE_MEM; ··· 1641 1506 goto out_del_list; 1642 1507 } 1643 1508 1644 - iommu_table_setparms_common(newtbl, pci->phb->bus->number, create.liobn, win_addr, 1645 - 1UL << len, page_shift, NULL, &iommu_table_lpar_multi_ops); 1509 + /* If the DDW is split between directly mapped RAM and Dynamic 1510 + * mapped for TCES, offset into the DDW where the dynamic part 1511 + * begins. 1512 + */ 1513 + dynamic_addr = win_addr + dynamic_offset; 1514 + dynamic_len = (1UL << len) - dynamic_offset; 1515 + iommu_table_setparms_common(newtbl, pci->phb->bus->number, create.liobn, 1516 + dynamic_addr, dynamic_len, page_shift, NULL, 1517 + &iommu_table_lpar_multi_ops); 1646 1518 iommu_init_table(newtbl, pci->phb->node, start, end); 1647 1519 1648 - pci->table_group->tables[1] = newtbl; 1520 + pci->table_group->tables[default_win_removed ? 0 : 1] = newtbl; 1649 1521 1650 1522 set_iommu_table_base(&dev->dev, newtbl); 1651 1523 } 1652 1524 1653 1525 if (default_win_removed) { 1654 - iommu_tce_table_put(pci->table_group->tables[0]); 1655 - pci->table_group->tables[0] = NULL; 1656 - 1657 1526 /* default_win is valid here because default_win_removed == true */ 1527 + if (!of_find_property(pdn, "ibm,dma-window-saved", NULL)) 1528 + copy_property(pdn, "ibm,dma-window", "ibm,dma-window-saved"); 1658 1529 of_remove_property(pdn, default_win); 1659 1530 dev_info(&dev->dev, "Removed default DMA window for %pOF\n", pdn); 1660 1531 } ··· 1700 1559 out_unlock: 1701 1560 mutex_unlock(&dma_win_init_mutex); 1702 1561 1703 - /* 1704 - * If we have persistent memory and the window size is only as big 1705 - * as RAM, then we failed to create a window to cover persistent 1706 - * memory and need to set the DMA limit. 1562 + /* If we have persistent memory and the window size is not big enough 1563 + * to directly map both RAM and vPMEM, then we need to set DMA limit. 1707 1564 */ 1708 - if (pmem_present && direct_mapping && len == max_ram_len) 1709 - dev->dev.bus_dma_limit = dev->dev.archdata.dma_offset + (1ULL << len); 1565 + if (pmem_present && direct_mapping && len != MAX_PHYSMEM_BITS) 1566 + dev->dev.bus_dma_limit = dev->dev.archdata.dma_offset + 1567 + (1ULL << max_ram_len); 1710 1568 1711 1569 return direct_mapping; 1570 + } 1571 + 1572 + static __u64 query_page_size_to_mask(u32 query_page_size) 1573 + { 1574 + const long shift[] = { 1575 + (SZ_4K), (SZ_64K), (SZ_16M), 1576 + (SZ_32M), (SZ_64M), (SZ_128M), 1577 + (SZ_256M), (SZ_16G), (SZ_2M) 1578 + }; 1579 + int i, ret = 0; 1580 + 1581 + for (i = 0; i < ARRAY_SIZE(shift); i++) { 1582 + if (query_page_size & (1 << i)) 1583 + ret |= shift[i]; 1584 + } 1585 + 1586 + return ret; 1587 + } 1588 + 1589 + static void spapr_tce_init_table_group(struct pci_dev *pdev, 1590 + struct device_node *pdn, 1591 + struct dynamic_dma_window_prop prop) 1592 + { 1593 + struct iommu_table_group *table_group = PCI_DN(pdn)->table_group; 1594 + u32 ddw_avail[DDW_APPLICABLE_SIZE]; 1595 + 1596 + struct ddw_query_response query; 1597 + int ret; 1598 + 1599 + /* Only for normal boot with default window. Doesn't matter during 1600 + * kdump, since these will not be used during kdump. 1601 + */ 1602 + if (is_kdump_kernel()) 1603 + return; 1604 + 1605 + if (table_group->max_dynamic_windows_supported != 0) 1606 + return; /* already initialized */ 1607 + 1608 + table_group->tce32_start = be64_to_cpu(prop.dma_base); 1609 + table_group->tce32_size = 1 << be32_to_cpu(prop.window_shift); 1610 + 1611 + if (!of_find_property(pdn, "ibm,dma-window", NULL)) 1612 + dev_err(&pdev->dev, "default dma window missing!\n"); 1613 + 1614 + ret = of_property_read_u32_array(pdn, "ibm,ddw-applicable", 1615 + &ddw_avail[0], DDW_APPLICABLE_SIZE); 1616 + if (ret) { 1617 + table_group->max_dynamic_windows_supported = -1; 1618 + return; 1619 + } 1620 + 1621 + ret = query_ddw(pdev, ddw_avail, &query, pdn); 1622 + if (ret) { 1623 + dev_err(&pdev->dev, "%s: query_ddw failed\n", __func__); 1624 + table_group->max_dynamic_windows_supported = -1; 1625 + return; 1626 + } 1627 + 1628 + if (query.windows_available == 0) 1629 + table_group->max_dynamic_windows_supported = 1; 1630 + else 1631 + table_group->max_dynamic_windows_supported = IOMMU_TABLE_GROUP_MAX_TABLES; 1632 + 1633 + table_group->max_levels = 1; 1634 + table_group->pgsizes |= query_page_size_to_mask(query.page_size); 1712 1635 } 1713 1636 1714 1637 static void pci_dma_dev_setup_pSeriesLP(struct pci_dev *dev) ··· 1814 1609 be32_to_cpu(prop.tce_shift), NULL, 1815 1610 &iommu_table_lpar_multi_ops); 1816 1611 1817 - /* Only for normal boot with default window. Doesn't matter even 1818 - * if we set these with DDW which is 64bit during kdump, since 1819 - * these will not be used during kdump. 1820 - */ 1821 - pci->table_group->tce32_start = be64_to_cpu(prop.dma_base); 1822 - pci->table_group->tce32_size = 1 << be32_to_cpu(prop.window_shift); 1823 - 1824 1612 iommu_init_table(tbl, pci->phb->node, 0, 0); 1825 1613 iommu_register_group(pci->table_group, 1826 1614 pci_domain_nr(pci->phb->bus), 0); ··· 1821 1623 } else { 1822 1624 pr_debug(" found DMA window, table: %p\n", pci->table_group); 1823 1625 } 1626 + 1627 + spapr_tce_init_table_group(dev, pdn, prop); 1824 1628 1825 1629 set_iommu_table_base(&dev->dev, pci->table_group->tables[0]); 1826 1630 iommu_add_device(pci->table_group, &dev->dev); ··· 1850 1650 1851 1651 return false; 1852 1652 } 1653 + 1654 + #ifdef CONFIG_IOMMU_API 1655 + /* 1656 + * A simple iommu_table_group_ops which only allows reusing the existing 1657 + * iommu_table. This handles VFIO for POWER7 or the nested KVM. 1658 + * The ops does not allow creating windows and only allows reusing the existing 1659 + * one if it matches table_group->tce32_start/tce32_size/page_shift. 1660 + */ 1661 + static unsigned long spapr_tce_get_table_size(__u32 page_shift, 1662 + __u64 window_size, __u32 levels) 1663 + { 1664 + unsigned long size; 1665 + 1666 + if (levels > 1) 1667 + return ~0U; 1668 + size = window_size >> (page_shift - 3); 1669 + return size; 1670 + } 1671 + 1672 + static struct pci_dev *iommu_group_get_first_pci_dev(struct iommu_group *group) 1673 + { 1674 + struct pci_dev *pdev = NULL; 1675 + int ret; 1676 + 1677 + /* No IOMMU group ? */ 1678 + if (!group) 1679 + return NULL; 1680 + 1681 + ret = iommu_group_for_each_dev(group, &pdev, dev_has_iommu_table); 1682 + if (!ret || !pdev) 1683 + return NULL; 1684 + return pdev; 1685 + } 1686 + 1687 + static void restore_default_dma_window(struct pci_dev *pdev, struct device_node *pdn) 1688 + { 1689 + reset_dma_window(pdev, pdn); 1690 + copy_property(pdn, "ibm,dma-window-saved", "ibm,dma-window"); 1691 + } 1692 + 1693 + static long remove_dynamic_dma_windows(struct pci_dev *pdev, struct device_node *pdn) 1694 + { 1695 + struct pci_dn *pci = PCI_DN(pdn); 1696 + struct dma_win *window; 1697 + bool direct_mapping; 1698 + int len; 1699 + 1700 + if (find_existing_ddw(pdn, &pdev->dev.archdata.dma_offset, &len, &direct_mapping)) { 1701 + remove_dma_window_named(pdn, true, direct_mapping ? 1702 + DIRECT64_PROPNAME : DMA64_PROPNAME, true); 1703 + if (!direct_mapping) { 1704 + WARN_ON(!pci->table_group->tables[0] && !pci->table_group->tables[1]); 1705 + 1706 + if (pci->table_group->tables[1]) { 1707 + iommu_tce_table_put(pci->table_group->tables[1]); 1708 + pci->table_group->tables[1] = NULL; 1709 + } else if (pci->table_group->tables[0]) { 1710 + /* Default window was removed and only the DDW exists */ 1711 + iommu_tce_table_put(pci->table_group->tables[0]); 1712 + pci->table_group->tables[0] = NULL; 1713 + } 1714 + } 1715 + spin_lock(&dma_win_list_lock); 1716 + list_for_each_entry(window, &dma_win_list, list) { 1717 + if (window->device == pdn) { 1718 + list_del(&window->list); 1719 + kfree(window); 1720 + break; 1721 + } 1722 + } 1723 + spin_unlock(&dma_win_list_lock); 1724 + } 1725 + 1726 + return 0; 1727 + } 1728 + 1729 + static long pseries_setup_default_iommu_config(struct iommu_table_group *table_group, 1730 + struct device *dev) 1731 + { 1732 + struct pci_dev *pdev = to_pci_dev(dev); 1733 + const __be32 *default_prop; 1734 + long liobn, offset, size; 1735 + struct device_node *pdn; 1736 + struct iommu_table *tbl; 1737 + struct pci_dn *pci; 1738 + 1739 + pdn = pci_dma_find_parent_node(pdev, table_group); 1740 + if (!pdn || !PCI_DN(pdn)) { 1741 + dev_warn(&pdev->dev, "No table_group configured for the node %pOF\n", pdn); 1742 + return -1; 1743 + } 1744 + pci = PCI_DN(pdn); 1745 + 1746 + /* The default window is restored if not present already on removal of DDW. 1747 + * However, if used by VFIO SPAPR sub driver, the user's order of removal of 1748 + * windows might have been different to not leading to auto restoration, 1749 + * suppose the DDW was removed first followed by the default one. 1750 + * So, restore the default window with reset-pe-dma call explicitly. 1751 + */ 1752 + restore_default_dma_window(pdev, pdn); 1753 + 1754 + default_prop = of_get_property(pdn, "ibm,dma-window", NULL); 1755 + of_parse_dma_window(pdn, default_prop, &liobn, &offset, &size); 1756 + tbl = iommu_pseries_alloc_table(pci->phb->node); 1757 + if (!tbl) { 1758 + dev_err(&pdev->dev, "couldn't create new IOMMU table\n"); 1759 + return -1; 1760 + } 1761 + 1762 + iommu_table_setparms_common(tbl, pci->phb->bus->number, liobn, offset, 1763 + size, IOMMU_PAGE_SHIFT_4K, NULL, 1764 + &iommu_table_lpar_multi_ops); 1765 + iommu_init_table(tbl, pci->phb->node, 0, 0); 1766 + 1767 + pci->table_group->tables[0] = tbl; 1768 + set_iommu_table_base(&pdev->dev, tbl); 1769 + 1770 + return 0; 1771 + } 1772 + 1773 + static bool is_default_window_request(struct iommu_table_group *table_group, __u32 page_shift, 1774 + __u64 window_size) 1775 + { 1776 + if ((window_size <= table_group->tce32_size) && 1777 + (page_shift == IOMMU_PAGE_SHIFT_4K)) 1778 + return true; 1779 + 1780 + return false; 1781 + } 1782 + 1783 + static long spapr_tce_create_table(struct iommu_table_group *table_group, int num, 1784 + __u32 page_shift, __u64 window_size, __u32 levels, 1785 + struct iommu_table **ptbl) 1786 + { 1787 + struct pci_dev *pdev = iommu_group_get_first_pci_dev(table_group->group); 1788 + u32 ddw_avail[DDW_APPLICABLE_SIZE]; 1789 + struct ddw_create_response create; 1790 + unsigned long liobn, offset, size; 1791 + unsigned long start = 0, end = 0; 1792 + struct ddw_query_response query; 1793 + const __be32 *default_prop; 1794 + struct failed_ddw_pdn *fpdn; 1795 + unsigned int window_shift; 1796 + struct device_node *pdn; 1797 + struct iommu_table *tbl; 1798 + struct dma_win *window; 1799 + struct property *win64; 1800 + struct pci_dn *pci; 1801 + u64 win_addr; 1802 + int len, i; 1803 + long ret; 1804 + 1805 + if (!is_power_of_2(window_size) || levels > 1) 1806 + return -EINVAL; 1807 + 1808 + window_shift = order_base_2(window_size); 1809 + 1810 + mutex_lock(&dma_win_init_mutex); 1811 + 1812 + ret = -ENODEV; 1813 + 1814 + pdn = pci_dma_find_parent_node(pdev, table_group); 1815 + if (!pdn || !PCI_DN(pdn)) { /* Niether of 32s|64-bit exist! */ 1816 + dev_warn(&pdev->dev, "No dma-windows exist for the node %pOF\n", pdn); 1817 + goto out_failed; 1818 + } 1819 + pci = PCI_DN(pdn); 1820 + 1821 + /* If the enable DDW failed for the pdn, dont retry! */ 1822 + list_for_each_entry(fpdn, &failed_ddw_pdn_list, list) { 1823 + if (fpdn->pdn == pdn) { 1824 + dev_info(&pdev->dev, "%pOF in failed DDW device list\n", pdn); 1825 + goto out_unlock; 1826 + } 1827 + } 1828 + 1829 + tbl = iommu_pseries_alloc_table(pci->phb->node); 1830 + if (!tbl) { 1831 + dev_dbg(&pdev->dev, "couldn't create new IOMMU table\n"); 1832 + goto out_unlock; 1833 + } 1834 + 1835 + if (num == 0) { 1836 + bool direct_mapping; 1837 + /* The request is not for default window? Ensure there is no DDW window already */ 1838 + if (!is_default_window_request(table_group, page_shift, window_size)) { 1839 + if (find_existing_ddw(pdn, &pdev->dev.archdata.dma_offset, &len, 1840 + &direct_mapping)) { 1841 + dev_warn(&pdev->dev, "%pOF: 64-bit window already present.", pdn); 1842 + ret = -EPERM; 1843 + goto out_unlock; 1844 + } 1845 + } else { 1846 + /* Request is for Default window, ensure there is no DDW if there is a 1847 + * need to reset. reset-pe otherwise removes the DDW also 1848 + */ 1849 + default_prop = of_get_property(pdn, "ibm,dma-window", NULL); 1850 + if (!default_prop) { 1851 + if (find_existing_ddw(pdn, &pdev->dev.archdata.dma_offset, &len, 1852 + &direct_mapping)) { 1853 + dev_warn(&pdev->dev, "%pOF: Attempt to create window#0 when 64-bit window is present. Preventing the attempt as that would destroy the 64-bit window", 1854 + pdn); 1855 + ret = -EPERM; 1856 + goto out_unlock; 1857 + } 1858 + 1859 + restore_default_dma_window(pdev, pdn); 1860 + 1861 + default_prop = of_get_property(pdn, "ibm,dma-window", NULL); 1862 + of_parse_dma_window(pdn, default_prop, &liobn, &offset, &size); 1863 + /* Limit the default window size to window_size */ 1864 + iommu_table_setparms_common(tbl, pci->phb->bus->number, liobn, 1865 + offset, 1UL << window_shift, 1866 + IOMMU_PAGE_SHIFT_4K, NULL, 1867 + &iommu_table_lpar_multi_ops); 1868 + iommu_init_table(tbl, pci->phb->node, start, end); 1869 + 1870 + table_group->tables[0] = tbl; 1871 + 1872 + mutex_unlock(&dma_win_init_mutex); 1873 + 1874 + goto exit; 1875 + } 1876 + } 1877 + } 1878 + 1879 + ret = of_property_read_u32_array(pdn, "ibm,ddw-applicable", 1880 + &ddw_avail[0], DDW_APPLICABLE_SIZE); 1881 + if (ret) { 1882 + dev_info(&pdev->dev, "ibm,ddw-applicable not found\n"); 1883 + goto out_failed; 1884 + } 1885 + ret = -ENODEV; 1886 + 1887 + pr_err("%s: Calling query %pOF\n", __func__, pdn); 1888 + ret = query_ddw(pdev, ddw_avail, &query, pdn); 1889 + if (ret) 1890 + goto out_failed; 1891 + ret = -ENODEV; 1892 + 1893 + len = window_shift; 1894 + if (query.largest_available_block < (1ULL << (len - page_shift))) { 1895 + dev_dbg(&pdev->dev, "can't map window 0x%llx with %llu %llu-sized pages\n", 1896 + 1ULL << len, query.largest_available_block, 1897 + 1ULL << page_shift); 1898 + ret = -EINVAL; /* Retry with smaller window size */ 1899 + goto out_unlock; 1900 + } 1901 + 1902 + if (create_ddw(pdev, ddw_avail, &create, page_shift, len)) { 1903 + pr_err("%s: Create ddw failed %pOF\n", __func__, pdn); 1904 + goto out_failed; 1905 + } 1906 + 1907 + win_addr = ((u64)create.addr_hi << 32) | create.addr_lo; 1908 + win64 = ddw_property_create(DMA64_PROPNAME, create.liobn, win_addr, page_shift, len); 1909 + if (!win64) 1910 + goto remove_window; 1911 + 1912 + ret = of_add_property(pdn, win64); 1913 + if (ret) { 1914 + dev_err(&pdev->dev, "unable to add DMA window property for %pOF: %ld", pdn, ret); 1915 + goto free_property; 1916 + } 1917 + ret = -ENODEV; 1918 + 1919 + window = ddw_list_new_entry(pdn, win64->value); 1920 + if (!window) 1921 + goto remove_property; 1922 + 1923 + window->direct = false; 1924 + 1925 + for (i = 0; i < ARRAY_SIZE(pci->phb->mem_resources); i++) { 1926 + const unsigned long mask = IORESOURCE_MEM_64 | IORESOURCE_MEM; 1927 + 1928 + /* Look for MMIO32 */ 1929 + if ((pci->phb->mem_resources[i].flags & mask) == IORESOURCE_MEM) { 1930 + start = pci->phb->mem_resources[i].start; 1931 + end = pci->phb->mem_resources[i].end; 1932 + break; 1933 + } 1934 + } 1935 + 1936 + /* New table for using DDW instead of the default DMA window */ 1937 + iommu_table_setparms_common(tbl, pci->phb->bus->number, create.liobn, win_addr, 1938 + 1UL << len, page_shift, NULL, &iommu_table_lpar_multi_ops); 1939 + iommu_init_table(tbl, pci->phb->node, start, end); 1940 + 1941 + pci->table_group->tables[num] = tbl; 1942 + set_iommu_table_base(&pdev->dev, tbl); 1943 + pdev->dev.archdata.dma_offset = win_addr; 1944 + 1945 + spin_lock(&dma_win_list_lock); 1946 + list_add(&window->list, &dma_win_list); 1947 + spin_unlock(&dma_win_list_lock); 1948 + 1949 + mutex_unlock(&dma_win_init_mutex); 1950 + 1951 + goto exit; 1952 + 1953 + remove_property: 1954 + of_remove_property(pdn, win64); 1955 + free_property: 1956 + kfree(win64->name); 1957 + kfree(win64->value); 1958 + kfree(win64); 1959 + remove_window: 1960 + __remove_dma_window(pdn, ddw_avail, create.liobn); 1961 + 1962 + out_failed: 1963 + fpdn = kzalloc(sizeof(*fpdn), GFP_KERNEL); 1964 + if (!fpdn) 1965 + goto out_unlock; 1966 + fpdn->pdn = pdn; 1967 + list_add(&fpdn->list, &failed_ddw_pdn_list); 1968 + 1969 + out_unlock: 1970 + mutex_unlock(&dma_win_init_mutex); 1971 + 1972 + return ret; 1973 + exit: 1974 + /* Allocate the userspace view */ 1975 + pseries_tce_iommu_userspace_view_alloc(tbl); 1976 + tbl->it_allocated_size = spapr_tce_get_table_size(page_shift, window_size, levels); 1977 + 1978 + *ptbl = iommu_tce_table_get(tbl); 1979 + 1980 + return 0; 1981 + } 1982 + 1983 + static bool is_default_window_table(struct iommu_table_group *table_group, struct iommu_table *tbl) 1984 + { 1985 + if (((tbl->it_size << tbl->it_page_shift) <= table_group->tce32_size) && 1986 + (tbl->it_page_shift == IOMMU_PAGE_SHIFT_4K)) 1987 + return true; 1988 + 1989 + return false; 1990 + } 1991 + 1992 + static long spapr_tce_set_window(struct iommu_table_group *table_group, 1993 + int num, struct iommu_table *tbl) 1994 + { 1995 + return tbl == table_group->tables[num] ? 0 : -EPERM; 1996 + } 1997 + 1998 + static long spapr_tce_unset_window(struct iommu_table_group *table_group, int num) 1999 + { 2000 + struct pci_dev *pdev = iommu_group_get_first_pci_dev(table_group->group); 2001 + struct device_node *dn = pci_device_to_OF_node(pdev), *pdn; 2002 + struct iommu_table *tbl = table_group->tables[num]; 2003 + struct failed_ddw_pdn *fpdn; 2004 + struct dma_win *window; 2005 + const char *win_name; 2006 + int ret = -ENODEV; 2007 + 2008 + mutex_lock(&dma_win_init_mutex); 2009 + 2010 + if ((num == 0) && is_default_window_table(table_group, tbl)) 2011 + win_name = "ibm,dma-window"; 2012 + else 2013 + win_name = DMA64_PROPNAME; 2014 + 2015 + pdn = pci_dma_find(dn, NULL); 2016 + if (!pdn || !PCI_DN(pdn)) { /* Niether of 32s|64-bit exist! */ 2017 + dev_warn(&pdev->dev, "No dma-windows exist for the node %pOF\n", pdn); 2018 + goto out_failed; 2019 + } 2020 + 2021 + /* Dont clear the TCEs, User should have done it */ 2022 + if (remove_dma_window_named(pdn, true, win_name, false)) { 2023 + pr_err("%s: The existing DDW removal failed for node %pOF\n", __func__, pdn); 2024 + goto out_failed; /* Could not remove it either! */ 2025 + } 2026 + 2027 + if (strcmp(win_name, DMA64_PROPNAME) == 0) { 2028 + spin_lock(&dma_win_list_lock); 2029 + list_for_each_entry(window, &dma_win_list, list) { 2030 + if (window->device == pdn) { 2031 + list_del(&window->list); 2032 + kfree(window); 2033 + break; 2034 + } 2035 + } 2036 + spin_unlock(&dma_win_list_lock); 2037 + } 2038 + 2039 + iommu_tce_table_put(table_group->tables[num]); 2040 + table_group->tables[num] = NULL; 2041 + 2042 + ret = 0; 2043 + 2044 + goto out_unlock; 2045 + 2046 + out_failed: 2047 + fpdn = kzalloc(sizeof(*fpdn), GFP_KERNEL); 2048 + if (!fpdn) 2049 + goto out_unlock; 2050 + fpdn->pdn = pdn; 2051 + list_add(&fpdn->list, &failed_ddw_pdn_list); 2052 + 2053 + out_unlock: 2054 + mutex_unlock(&dma_win_init_mutex); 2055 + 2056 + return ret; 2057 + } 2058 + 2059 + static long spapr_tce_take_ownership(struct iommu_table_group *table_group, struct device *dev) 2060 + { 2061 + struct iommu_table *tbl = table_group->tables[0]; 2062 + struct pci_dev *pdev = to_pci_dev(dev); 2063 + struct device_node *dn = pci_device_to_OF_node(pdev); 2064 + struct device_node *pdn; 2065 + 2066 + /* SRIOV VFs using direct map by the host driver OR multifunction devices 2067 + * where the ownership was taken on the attempt by the first function 2068 + */ 2069 + if (!tbl && (table_group->max_dynamic_windows_supported != 1)) 2070 + return 0; 2071 + 2072 + mutex_lock(&dma_win_init_mutex); 2073 + 2074 + pdn = pci_dma_find(dn, NULL); 2075 + if (!pdn || !PCI_DN(pdn)) { /* Niether of 32s|64-bit exist! */ 2076 + dev_warn(&pdev->dev, "No dma-windows exist for the node %pOF\n", pdn); 2077 + mutex_unlock(&dma_win_init_mutex); 2078 + return -1; 2079 + } 2080 + 2081 + /* 2082 + * Though rtas call reset-pe removes the DDW, it doesn't clear the entries on the table 2083 + * if there are any. In case of direct map, the entries will be left over, which 2084 + * is fine for PEs with 2 DMA windows where the second window is created with create-pe 2085 + * at which point the table is cleared. However, on VFs having only one DMA window, the 2086 + * default window would end up seeing the entries left over from the direct map done 2087 + * on the second window. So, remove the ddw explicitly so that clean_dma_window() 2088 + * cleans up the entries if any. 2089 + */ 2090 + if (remove_dynamic_dma_windows(pdev, pdn)) { 2091 + dev_warn(&pdev->dev, "The existing DDW removal failed for node %pOF\n", pdn); 2092 + mutex_unlock(&dma_win_init_mutex); 2093 + return -1; 2094 + } 2095 + 2096 + /* The table_group->tables[0] is not null now, it must be the default window 2097 + * Remove it, let the userspace create it as it needs. 2098 + */ 2099 + if (table_group->tables[0]) { 2100 + remove_dma_window_named(pdn, true, "ibm,dma-window", true); 2101 + iommu_tce_table_put(tbl); 2102 + table_group->tables[0] = NULL; 2103 + } 2104 + set_iommu_table_base(dev, NULL); 2105 + 2106 + mutex_unlock(&dma_win_init_mutex); 2107 + 2108 + return 0; 2109 + } 2110 + 2111 + static void spapr_tce_release_ownership(struct iommu_table_group *table_group, struct device *dev) 2112 + { 2113 + struct iommu_table *tbl = table_group->tables[0]; 2114 + 2115 + if (tbl) { /* Default window already restored */ 2116 + return; 2117 + } 2118 + 2119 + mutex_lock(&dma_win_init_mutex); 2120 + 2121 + /* Restore the default window */ 2122 + pseries_setup_default_iommu_config(table_group, dev); 2123 + 2124 + mutex_unlock(&dma_win_init_mutex); 2125 + 2126 + return; 2127 + } 2128 + 2129 + static struct iommu_table_group_ops spapr_tce_table_group_ops = { 2130 + .get_table_size = spapr_tce_get_table_size, 2131 + .create_table = spapr_tce_create_table, 2132 + .set_window = spapr_tce_set_window, 2133 + .unset_window = spapr_tce_unset_window, 2134 + .take_ownership = spapr_tce_take_ownership, 2135 + .release_ownership = spapr_tce_release_ownership, 2136 + }; 2137 + #endif 1853 2138 1854 2139 static int iommu_mem_notifier(struct notifier_block *nb, unsigned long action, 1855 2140 void *data) ··· 2397 1712 * we have to remove the property when releasing 2398 1713 * the device node. 2399 1714 */ 2400 - if (remove_ddw(np, false, DIRECT64_PROPNAME)) 2401 - remove_ddw(np, false, DMA64_PROPNAME); 1715 + if (remove_dma_window_named(np, false, DIRECT64_PROPNAME, true)) 1716 + remove_dma_window_named(np, false, DMA64_PROPNAME, true); 2402 1717 2403 1718 if (pci && pci->table_group) 2404 1719 iommu_pseries_free_group(pci->table_group,
+1
arch/powerpc/platforms/pseries/papr_scm.c
··· 1536 1536 module_exit(papr_scm_exit); 1537 1537 1538 1538 MODULE_DEVICE_TABLE(of, papr_scm_match); 1539 + MODULE_DESCRIPTION("PAPR Storage Class Memory interface driver"); 1539 1540 MODULE_LICENSE("GPL"); 1540 1541 MODULE_AUTHOR("IBM Corporation");
+14
arch/powerpc/platforms/pseries/pci_dlpar.c
··· 11 11 12 12 #include <linux/pci.h> 13 13 #include <linux/export.h> 14 + #include <linux/node.h> 14 15 #include <asm/pci-bridge.h> 15 16 #include <asm/ppc-pci.h> 16 17 #include <asm/firmware.h> ··· 22 21 struct pci_controller *init_phb_dynamic(struct device_node *dn) 23 22 { 24 23 struct pci_controller *phb; 24 + int nid; 25 25 26 26 pr_debug("PCI: Initializing new hotplug PHB %pOF\n", dn); 27 + 28 + nid = of_node_to_nid(dn); 29 + if (likely((nid) >= 0)) { 30 + if (!node_online(nid)) { 31 + if (__register_one_node(nid)) { 32 + pr_err("PCI: Failed to register node %d\n", nid); 33 + } else { 34 + update_numa_distance(dn); 35 + node_set_online(nid); 36 + } 37 + } 38 + } 27 39 28 40 phb = pcibios_alloc_controller(dn); 29 41 if (!phb)
+21 -1
arch/powerpc/platforms/pseries/vas.c
··· 38 38 { 39 39 /* Check if we are stalled for some time */ 40 40 if (H_IS_LONG_BUSY(rc)) { 41 - msleep(get_longbusy_msecs(rc)); 41 + unsigned int ms; 42 + /* 43 + * Allocate, Modify and Deallocate HCALLs returns 44 + * H_LONG_BUSY_ORDER_1_MSEC or H_LONG_BUSY_ORDER_10_MSEC 45 + * for the long delay. So the sleep time should always 46 + * be either 1 or 10msecs, but in case if the HCALL 47 + * returns the long delay > 10 msecs, clamp the sleep 48 + * time to 10msecs. 49 + */ 50 + ms = clamp(get_longbusy_msecs(rc), 1, 10); 51 + 52 + /* 53 + * msleep() will often sleep at least 20 msecs even 54 + * though the hypervisor suggests that the OS reissue 55 + * HCALLs after 1 or 10msecs. Also the delay hint from 56 + * the HCALL is just a suggestion. So OK to pause for 57 + * less time than the hinted delay. Use usleep_range() 58 + * to ensure we don't sleep much longer than actually 59 + * needed. 60 + */ 61 + usleep_range(ms * (USEC_PER_MSEC / 10), ms * USEC_PER_MSEC); 42 62 rc = H_BUSY; 43 63 } else if (rc == H_BUSY) { 44 64 cond_resched();
+2 -2
arch/powerpc/sysdev/Kconfig
··· 5 5 6 6 config PPC4xx_PCI_EXPRESS 7 7 bool 8 - depends on PCI && 4xx 8 + depends on PCI && 44x 9 9 10 10 config PPC4xx_HSTA_MSI 11 11 bool 12 12 depends on PCI_MSI 13 - depends on PCI && 4xx 13 + depends on PCI && 44x 14 14 15 15 config PPC_MSI_BITMAP 16 16 bool
+1
arch/powerpc/sysdev/rtc_cmos_setup.c
··· 66 66 } 67 67 fs_initcall(add_rtc); 68 68 69 + MODULE_DESCRIPTION("PPC RTC CMOS driver"); 69 70 MODULE_LICENSE("GPL");
+11 -22
arch/powerpc/xmon/ppc-dis.c
··· 122 122 bool insn_is_short; 123 123 ppc_cpu_t dialect; 124 124 125 - dialect = PPC_OPCODE_PPC | PPC_OPCODE_COMMON 126 - | PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_ALTIVEC; 125 + dialect = PPC_OPCODE_PPC | PPC_OPCODE_COMMON; 127 126 128 - if (cpu_has_feature(CPU_FTRS_POWER5)) 129 - dialect |= PPC_OPCODE_POWER5; 127 + if (IS_ENABLED(CONFIG_PPC64)) 128 + dialect |= PPC_OPCODE_64 | PPC_OPCODE_POWER4 | PPC_OPCODE_CELL | 129 + PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 | PPC_OPCODE_POWER8 | 130 + PPC_OPCODE_POWER9; 130 131 131 - if (cpu_has_feature(CPU_FTRS_CELL)) 132 - dialect |= (PPC_OPCODE_CELL | PPC_OPCODE_ALTIVEC); 132 + if (cpu_has_feature(CPU_FTR_TM)) 133 + dialect |= PPC_OPCODE_HTM; 133 134 134 - if (cpu_has_feature(CPU_FTRS_POWER6)) 135 - dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_ALTIVEC); 135 + if (cpu_has_feature(CPU_FTR_ALTIVEC)) 136 + dialect |= PPC_OPCODE_ALTIVEC | PPC_OPCODE_ALTIVEC2; 136 137 137 - if (cpu_has_feature(CPU_FTRS_POWER7)) 138 - dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 139 - | PPC_OPCODE_ALTIVEC | PPC_OPCODE_VSX); 140 - 141 - if (cpu_has_feature(CPU_FTRS_POWER8)) 142 - dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 143 - | PPC_OPCODE_POWER8 | PPC_OPCODE_HTM 144 - | PPC_OPCODE_ALTIVEC | PPC_OPCODE_ALTIVEC2 | PPC_OPCODE_VSX); 145 - 146 - if (cpu_has_feature(CPU_FTRS_POWER9)) 147 - dialect |= (PPC_OPCODE_POWER5 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 148 - | PPC_OPCODE_POWER8 | PPC_OPCODE_POWER9 | PPC_OPCODE_HTM 149 - | PPC_OPCODE_ALTIVEC | PPC_OPCODE_ALTIVEC2 150 - | PPC_OPCODE_VSX | PPC_OPCODE_VSX3); 138 + if (cpu_has_feature(CPU_FTR_VSX)) 139 + dialect |= PPC_OPCODE_VSX | PPC_OPCODE_VSX3; 151 140 152 141 /* Get the major opcode of the insn. */ 153 142 opcode = NULL;
+1 -1
drivers/macintosh/ams/ams-i2c.c
··· 60 60 static void ams_i2c_remove(struct i2c_client *client); 61 61 62 62 static const struct i2c_device_id ams_id[] = { 63 - { "MAC,accelerometer_1", 0 }, 63 + { "MAC,accelerometer_1" }, 64 64 { } 65 65 }; 66 66 MODULE_DEVICE_TABLE(i2c, ams_id);
+1
drivers/macintosh/mac_hid.c
··· 16 16 #include <linux/module.h> 17 17 #include <linux/slab.h> 18 18 19 + MODULE_DESCRIPTION("Mouse button 2+3 emulation"); 19 20 MODULE_LICENSE("GPL"); 20 21 21 22 static int mouse_emulate_buttons;
+1 -1
drivers/macintosh/therm_windtunnel.c
··· 549 549 platform_driver_unregister( &therm_of_driver ); 550 550 551 551 if( x.of_dev ) 552 - of_device_unregister( x.of_dev ); 552 + of_platform_device_destroy(&x.of_dev->dev, NULL); 553 553 } 554 554 555 555 module_init(g4fan_init);
+1 -1
drivers/macintosh/windfarm_ad7417_sensor.c
··· 304 304 } 305 305 306 306 static const struct i2c_device_id wf_ad7417_id[] = { 307 - { "MAC,ad7417", 0 }, 307 + { "MAC,ad7417" }, 308 308 { } 309 309 }; 310 310 MODULE_DEVICE_TABLE(i2c, wf_ad7417_id);
+1 -1
drivers/macintosh/windfarm_fcu_controls.c
··· 573 573 } 574 574 575 575 static const struct i2c_device_id wf_fcu_id[] = { 576 - { "MAC,fcu", 0 }, 576 + { "MAC,fcu" }, 577 577 { } 578 578 }; 579 579 MODULE_DEVICE_TABLE(i2c, wf_fcu_id);
+1 -1
drivers/macintosh/windfarm_lm87_sensor.c
··· 156 156 } 157 157 158 158 static const struct i2c_device_id wf_lm87_id[] = { 159 - { "MAC,lm87cimt", 0 }, 159 + { "MAC,lm87cimt" }, 160 160 { } 161 161 }; 162 162 MODULE_DEVICE_TABLE(i2c, wf_lm87_id);
+1 -1
drivers/macintosh/windfarm_max6690_sensor.c
··· 112 112 } 113 113 114 114 static const struct i2c_device_id wf_max6690_id[] = { 115 - { "MAC,max6690", 0 }, 115 + { "MAC,max6690" }, 116 116 { } 117 117 }; 118 118 MODULE_DEVICE_TABLE(i2c, wf_max6690_id);
+1 -1
drivers/macintosh/windfarm_smu_sat.c
··· 333 333 } 334 334 335 335 static const struct i2c_device_id wf_sat_id[] = { 336 - { "MAC,smu-sat", 0 }, 336 + { "MAC,smu-sat" }, 337 337 { } 338 338 }; 339 339 MODULE_DEVICE_TABLE(i2c, wf_sat_id);
+1 -2
drivers/pci/hotplug/pnv_php.c
··· 40 40 bool disable_device) 41 41 { 42 42 struct pci_dev *pdev = php_slot->pdev; 43 - int irq = php_slot->irq; 44 43 u16 ctrl; 45 44 46 45 if (php_slot->irq > 0) { ··· 58 59 php_slot->wq = NULL; 59 60 } 60 61 61 - if (disable_device || irq > 0) { 62 + if (disable_device) { 62 63 if (pdev->msix_enabled) 63 64 pci_disable_msix(pdev); 64 65 else if (pdev->msi_enabled)
+9 -4
drivers/vfio/vfio_iommu_spapr_tce.c
··· 364 364 if (!tbl) 365 365 continue; 366 366 367 - tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size); 368 367 tce_iommu_free_table(container, tbl); 369 368 } 370 369 ··· 719 720 720 721 BUG_ON(!tbl->it_size); 721 722 723 + tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size); 724 + 722 725 /* Detach groups from IOMMUs */ 723 726 list_for_each_entry(tcegrp, &container->group_list, next) { 724 727 table_group = iommu_group_get_iommudata(tcegrp->grp); ··· 739 738 } 740 739 741 740 /* Free table */ 742 - tce_iommu_clear(container, tbl, tbl->it_offset, tbl->it_size); 743 741 tce_iommu_free_table(container, tbl); 744 742 container->tables[num] = NULL; 745 743 ··· 1197 1197 return; 1198 1198 } 1199 1199 1200 - for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i) 1201 - if (container->tables[i]) 1200 + for (i = 0; i < IOMMU_TABLE_GROUP_MAX_TABLES; ++i) { 1201 + if (container->tables[i]) { 1202 + tce_iommu_clear(container, container->tables[i], 1203 + container->tables[i]->it_offset, 1204 + container->tables[i]->it_size); 1202 1205 table_group->ops->unset_window(table_group, i); 1206 + } 1207 + } 1203 1208 } 1204 1209 1205 1210 static long tce_iommu_take_ownership(struct tce_container *container,
-1
scripts/head-object-list.txt
··· 27 27 arch/nios2/kernel/head.o 28 28 arch/openrisc/kernel/head.o 29 29 arch/parisc/kernel/head.o 30 - arch/powerpc/kernel/head_40x.o 31 30 arch/powerpc/kernel/head_44x.o 32 31 arch/powerpc/kernel/head_64.o 33 32 arch/powerpc/kernel/head_8xx.o
+1 -1
tools/testing/selftests/sigaltstack/current_stack_pointer.h
··· 8 8 register unsigned long sp asm("esp"); 9 9 #elif __loongarch64 10 10 register unsigned long sp asm("$sp"); 11 - #elif __ppc__ 11 + #elif __powerpc__ 12 12 register unsigned long sp asm("r1"); 13 13 #elif __s390x__ 14 14 register unsigned long sp asm("%15");