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

Merge tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC platform updates from Arnd Bergmann:
"This release brings up a new platform based on the old ARM9 core: the
Nuvoton NPCM is used as a baseboard management controller, competing
with the better known ASpeed AST2xx series.

Another important change is the addition of ARMv7-A based chips in
mach-stm32. The older parts in this platform are ARMv7-M based
microcontrollers, now they are expanding to general-purpose workloads.

The other changes are the usual defconfig updates to enable additional
drivers, lesser bugfixes. The largest updates as often are the ongoing
OMAP cleanups, but we also have a number of changes for the older PXA
and davinci platforms this time.

For the Renesas shmobile/r-car platform, some new infrastructure is
needed to make the watchdog work correctly.

Supporting Multiprocessing on Allwinner A80 required a significant
amount of new code, but is not doing anything unexpected"

* tag 'armsoc-soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (179 commits)
arm: npcm: modify configuration for the NPCM7xx BMC.
MAINTAINERS: update entry for ARM/berlin
ARM: omap2: fix am43xx build without L2X0
ARM: davinci: da8xx: simplify CFGCHIP regmap_config
ARM: davinci: da8xx: fix oops in USB PHY driver due to stack allocated platform_data
ARM: multi_v7_defconfig: add NXP FlexCAN IP support
ARM: multi_v7_defconfig: enable thermal driver for i.MX devices
ARM: multi_v7_defconfig: add RN5T618 PMIC family support
ARM: multi_v7_defconfig: add NXP graphics drivers
ARM: multi_v7_defconfig: add GPMI NAND controller support
ARM: multi_v7_defconfig: add OCOTP driver for NXP SoCs
ARM: multi_v7_defconfig: configure I2C driver built-in
arm64: defconfig: add CONFIG_UNIPHIER_THERMAL and CONFIG_SNI_AVE
ARM: imx: fix imx6sll-only build
ARM: imx: select ARM_CPU_SUSPEND for CPU_IDLE as well
ARM: mxs_defconfig: Re-sync defconfig
ARM: imx_v4_v5_defconfig: Use the generic fsl-asoc-card driver
ARM: imx_v4_v5_defconfig: Re-sync defconfig
arm64: defconfig: enable stmmac ethernet to defconfig
ARM: EXYNOS: Simplify code in coupled CPU idle hot path
...

+4977 -3964
+25 -27
Documentation/arm/Atmel/README Documentation/arm/Microchip/README
··· 1 - ARM Atmel SoCs (aka AT91) 2 - ========================= 1 + ARM Microchip SoCs (aka AT91) 2 + ============================= 3 3 4 4 5 5 Introduction 6 6 ------------ 7 - This document gives useful information about the ARM Atmel SoCs that are 7 + This document gives useful information about the ARM Microchip SoCs that are 8 8 currently supported in Linux Mainline (you know, the one on kernel.org). 9 9 10 - It is important to note that the Atmel | SMART ARM-based MPU product line is 11 - historically named "AT91" or "at91" throughout the Linux kernel development 12 - process even if this product prefix has completely disappeared from the 13 - official Atmel product name. Anyway, files, directories, git trees, 10 + It is important to note that the Microchip (previously Atmel) ARM-based MPU 11 + product line is historically named "AT91" or "at91" throughout the Linux kernel 12 + development process even if this product prefix has completely disappeared from 13 + the official Microchip product name. Anyway, files, directories, git trees, 14 14 git branches/tags and email subject always contain this "at91" sub-string. 15 15 16 16 17 17 AT91 SoCs 18 18 --------- 19 19 Documentation and detailed datasheet for each product are available on 20 - the Atmel website: http://www.atmel.com. 20 + the Microchip website: http://www.microchip.com. 21 21 22 22 Flavors: 23 23 * ARM 920 based SoC 24 24 - at91rm9200 25 25 + Datasheet 26 - http://www.atmel.com/Images/doc1768.pdf 26 + http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-1768-32-bit-ARM920T-Embedded-Microprocessor-AT91RM9200_Datasheet.pdf 27 27 28 28 * ARM 926 based SoCs 29 29 - at91sam9260 30 30 + Datasheet 31 - http://www.atmel.com/Images/doc6221.pdf 31 + http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6221-32-bit-ARM926EJ-S-Embedded-Microprocessor-SAM9260_Datasheet.pdf 32 32 33 33 - at91sam9xe 34 34 + Datasheet 35 - http://www.atmel.com/Images/Atmel-6254-32-bit-ARM926EJ-S-Embedded-Microprocessor-SAM9XE_Datasheet.pdf 35 + http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6254-32-bit-ARM926EJ-S-Embedded-Microprocessor-SAM9XE_Datasheet.pdf 36 36 37 37 - at91sam9261 38 38 + Datasheet 39 - http://www.atmel.com/Images/doc6062.pdf 39 + http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6062-ARM926EJ-S-Microprocessor-SAM9261_Datasheet.pdf 40 40 41 41 - at91sam9263 42 42 + Datasheet 43 - http://www.atmel.com/Images/Atmel_6249_32-bit-ARM926EJ-S-Microcontroller_SAM9263_Datasheet.pdf 43 + http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6249-32-bit-ARM926EJ-S-Embedded-Microprocessor-SAM9263_Datasheet.pdf 44 44 45 45 - at91sam9rl 46 46 + Datasheet 47 - http://www.atmel.com/Images/doc6289.pdf 47 + http://ww1.microchip.com/downloads/en/DeviceDoc/doc6289.pdf 48 48 49 49 - at91sam9g20 50 50 + Datasheet 51 - http://www.atmel.com/Images/doc6384.pdf 51 + http://ww1.microchip.com/downloads/en/DeviceDoc/DS60001516A.pdf 52 52 53 53 - at91sam9g45 family 54 54 - at91sam9g45 ··· 56 56 - at91sam9m10 57 57 - at91sam9m11 (device superset) 58 58 + Datasheet 59 - http://www.atmel.com/Images/Atmel-6437-32-bit-ARM926-Embedded-Microprocessor-SAM9M11_Datasheet.pdf 59 + http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-6437-32-bit-ARM926-Embedded-Microprocessor-SAM9M11_Datasheet.pdf 60 60 61 61 - at91sam9x5 family (aka "The 5 series") 62 62 - at91sam9g15 ··· 65 65 - at91sam9x25 66 66 - at91sam9x35 67 67 + Datasheet (can be considered as covering the whole family) 68 - http://www.atmel.com/Images/Atmel_11055_32-bit-ARM926EJ-S-Microcontroller_SAM9X35_Datasheet.pdf 68 + http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11055-32-bit-ARM926EJ-S-Microcontroller-SAM9X35_Datasheet.pdf 69 69 70 70 - at91sam9n12 71 71 + Datasheet 72 - http://www.atmel.com/Images/Atmel_11063_32-bit-ARM926EJ-S-Microcontroller_SAM9N12CN11CN12_Datasheet.pdf 72 + http://ww1.microchip.com/downloads/en/DeviceDoc/DS60001517A.pdf 73 73 74 74 * ARM Cortex-A5 based SoCs 75 75 - sama5d3 family ··· 79 79 - sama5d35 80 80 - sama5d36 (device superset) 81 81 + Datasheet 82 - http://www.atmel.com/Images/Atmel-11121-32-bit-Cortex-A5-Microcontroller-SAMA5D3_Datasheet.pdf 82 + http://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-11121-32-bit-Cortex-A5-Microcontroller-SAMA5D3_Datasheet.pdf 83 83 84 84 * ARM Cortex-A5 + NEON based SoCs 85 85 - sama5d4 family ··· 88 88 - sama5d43 89 89 - sama5d44 (device superset) 90 90 + Datasheet 91 - http://www.atmel.com/Images/Atmel-11238-32-bit-Cortex-A5-Microcontroller-SAMA5D4_Datasheet.pdf 91 + http://ww1.microchip.com/downloads/en/DeviceDoc/60001525A.pdf 92 92 93 93 - sama5d2 family 94 94 - sama5d21 ··· 99 99 - sama5d27 (device superset) 100 100 - sama5d28 (device superset + environmental monitors) 101 101 + Datasheet 102 - http://www.atmel.com/Images/Atmel-11267-32-bit-Cortex-A5-Microcontroller-SAMA5D2_Datasheet.pdf 102 + http://ww1.microchip.com/downloads/en/DeviceDoc/DS60001476B.pdf 103 103 104 104 * ARM Cortex-M7 MCUs 105 105 - sams70 family ··· 112 112 - sams70q19 113 113 - sams70q20 114 114 - sams70q21 115 - + Datasheet 116 - http://www.atmel.com/Images/Atmel-11242-32-bit-Cortex-M7-Microcontroller-SAM-S70Q-SAM-S70N-SAM-S70J_Datasheet.pdf 117 115 118 116 - samv70 family 119 117 - samv70j19 ··· 120 122 - samv70n20 121 123 - samv70q19 122 124 - samv70q20 123 - + Datasheet 124 - http://www.atmel.com/Images/Atmel-11297-32-bit-Cortex-M7-Microcontroller-SAM-V70Q-SAM-V70N-SAM-V70J_Datasheet.pdf 125 125 126 126 - samv71 family 127 127 - samv71j19 ··· 131 135 - samv71q19 132 136 - samv71q20 133 137 - samv71q21 138 + 134 139 + Datasheet 135 - http://www.atmel.com/Images/Atmel-44003-32-bit-Cortex-M7-Microcontroller-SAM-V71Q-SAM-V71N-SAM-V71J_Datasheet.pdf 140 + http://ww1.microchip.com/downloads/en/DeviceDoc/60001527A.pdf 141 + 136 142 137 143 Linux kernel information 138 144 ------------------------ 139 145 Linux kernel mach directory: arch/arm/mach-at91 140 - MAINTAINERS entry is: "ARM/ATMEL AT91RM9200 AND AT91SAM ARM ARCHITECTURES" 146 + MAINTAINERS entry is: "ARM/Microchip (AT91) SoC support" 141 147 142 148 143 149 Device Tree for AT91 SoCs and boards
+34
Documentation/arm/stm32/overview.rst
··· 1 + ======================== 2 + STM32 ARM Linux Overview 3 + ======================== 4 + 5 + Introduction 6 + ------------ 7 + 8 + The STMicroelectronics STM32 family of Cortex-A microprocessors (MPUs) and 9 + Cortex-M microcontrollers (MCUs) are supported by the 'STM32' platform of 10 + ARM Linux. 11 + 12 + Configuration 13 + ------------- 14 + 15 + For MCUs, use the provided default configuration: 16 + make stm32_defconfig 17 + For MPUs, use multi_v7 configuration: 18 + make multi_v7_defconfig 19 + 20 + Layout 21 + ------ 22 + 23 + All the files for multiple machine families are located in the platform code 24 + contained in arch/arm/mach-stm32 25 + 26 + There is a generic board board-dt.c in the mach folder which support 27 + Flattened Device Tree, which means, it works with any compatible board with 28 + Device Trees. 29 + 30 + :Authors: 31 + 32 + - Maxime Coquelin <mcoquelin.stm32@gmail.com> 33 + - Ludovic Barre <ludovic.barre@st.com> 34 + - Gerald Baeza <gerald.baeza@st.com>
-33
Documentation/arm/stm32/overview.txt
··· 1 - STM32 ARM Linux Overview 2 - ======================== 3 - 4 - Introduction 5 - ------------ 6 - 7 - The STMicroelectronics family of Cortex-M based MCUs are supported by the 8 - 'STM32' platform of ARM Linux. Currently only the STM32F429 (Cortex-M4) 9 - and STM32F746 (Cortex-M7) are supported. 10 - 11 - 12 - Configuration 13 - ------------- 14 - 15 - A generic configuration is provided for STM32 family, and can be used as the 16 - default by 17 - make stm32_defconfig 18 - 19 - Layout 20 - ------ 21 - 22 - All the files for multiple machine families are located in the platform code 23 - contained in arch/arm/mach-stm32 24 - 25 - There is a generic board board-dt.c in the mach folder which support 26 - Flattened Device Tree, which means, it works with any compatible board with 27 - Device Trees. 28 - 29 - 30 - Document Author 31 - --------------- 32 - 33 - Maxime Coquelin <mcoquelin.stm32@gmail.com>
+26
Documentation/arm/stm32/stm32f429-overview.rst
··· 1 + STM32F429 Overview 2 + ================== 3 + 4 + Introduction 5 + ------------ 6 + 7 + The STM32F429 is a Cortex-M4 MCU aimed at various applications. 8 + It features: 9 + 10 + - ARM Cortex-M4 up to 180MHz with FPU 11 + - 2MB internal Flash Memory 12 + - External memory support through FMC controller (PSRAM, SDRAM, NOR, NAND) 13 + - I2C, SPI, SAI, CAN, USB OTG, Ethernet controllers 14 + - LCD controller & Camera interface 15 + - Cryptographic processor 16 + 17 + Resources 18 + --------- 19 + 20 + Datasheet and reference manual are publicly available on ST website (STM32F429_). 21 + 22 + .. _STM32F429: http://www.st.com/web/en/catalog/mmc/FM141/SC1169/SS1577/LN1806?ecmp=stm32f429-439_pron_pr-ces2014_nov2013 23 + 24 + :Authors: 25 + 26 + Maxime Coquelin <mcoquelin.stm32@gmail.com>
-22
Documentation/arm/stm32/stm32f429-overview.txt
··· 1 - STM32F429 Overview 2 - ================== 3 - 4 - Introduction 5 - ------------ 6 - The STM32F429 is a Cortex-M4 MCU aimed at various applications. 7 - It features: 8 - - ARM Cortex-M4 up to 180MHz with FPU 9 - - 2MB internal Flash Memory 10 - - External memory support through FMC controller (PSRAM, SDRAM, NOR, NAND) 11 - - I2C, SPI, SAI, CAN, USB OTG, Ethernet controllers 12 - - LCD controller & Camera interface 13 - - Cryptographic processor 14 - 15 - Resources 16 - --------- 17 - Datasheet and reference manual are publicly available on ST website: 18 - - http://www.st.com/web/en/catalog/mmc/FM141/SC1169/SS1577/LN1806?ecmp=stm32f429-439_pron_pr-ces2014_nov2013 19 - 20 - Document Author 21 - --------------- 22 - Maxime Coquelin <mcoquelin.stm32@gmail.com>
+33
Documentation/arm/stm32/stm32f746-overview.rst
··· 1 + STM32F746 Overview 2 + ================== 3 + 4 + Introduction 5 + ------------ 6 + 7 + The STM32F746 is a Cortex-M7 MCU aimed at various applications. 8 + It features: 9 + 10 + - Cortex-M7 core running up to @216MHz 11 + - 1MB internal flash, 320KBytes internal RAM (+4KB of backup SRAM) 12 + - FMC controller to connect SDRAM, NOR and NAND memories 13 + - Dual mode QSPI 14 + - SD/MMC/SDIO support 15 + - Ethernet controller 16 + - USB OTFG FS & HS controllers 17 + - I2C, SPI, CAN busses support 18 + - Several 16 & 32 bits general purpose timers 19 + - Serial Audio interface 20 + - LCD controller 21 + - HDMI-CEC 22 + - SPDIFRX 23 + 24 + Resources 25 + --------- 26 + 27 + Datasheet and reference manual are publicly available on ST website (STM32F746_). 28 + 29 + .. _STM32F746: http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32f7-series/stm32f7x6/stm32f746ng.html 30 + 31 + :Authors: 32 + 33 + Alexandre Torgue <alexandre.torgue@st.com>
-34
Documentation/arm/stm32/stm32f746-overview.txt
··· 1 - STM32F746 Overview 2 - ================== 3 - 4 - Introduction 5 - ------------ 6 - The STM32F746 is a Cortex-M7 MCU aimed at various applications. 7 - It features: 8 - - Cortex-M7 core running up to @216MHz 9 - - 1MB internal flash, 320KBytes internal RAM (+4KB of backup SRAM) 10 - - FMC controller to connect SDRAM, NOR and NAND memories 11 - - Dual mode QSPI 12 - - SD/MMC/SDIO support 13 - - Ethernet controller 14 - - USB OTFG FS & HS controllers 15 - - I2C, SPI, CAN busses support 16 - - Several 16 & 32 bits general purpose timers 17 - - Serial Audio interface 18 - - LCD controller 19 - - HDMI-CEC 20 - - SPDIFRX 21 - 22 - Resources 23 - --------- 24 - Datasheet and reference manual are publicly available on ST website: 25 - - http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32f7-series/stm32f7x6/stm32f746ng.html 26 - 27 - Document Author 28 - --------------- 29 - Alexandre Torgue <alexandre.torgue@st.com> 30 - 31 - 32 - 33 - 34 -
+35
Documentation/arm/stm32/stm32f769-overview.rst
··· 1 + STM32F769 Overview 2 + ================== 3 + 4 + Introduction 5 + ------------ 6 + 7 + The STM32F769 is a Cortex-M7 MCU aimed at various applications. 8 + It features: 9 + 10 + - Cortex-M7 core running up to @216MHz 11 + - 2MB internal flash, 512KBytes internal RAM (+4KB of backup SRAM) 12 + - FMC controller to connect SDRAM, NOR and NAND memories 13 + - Dual mode QSPI 14 + - SD/MMC/SDIO support*2 15 + - Ethernet controller 16 + - USB OTFG FS & HS controllers 17 + - I2C*4, SPI*6, CAN*3 busses support 18 + - Several 16 & 32 bits general purpose timers 19 + - Serial Audio interface*2 20 + - LCD controller 21 + - HDMI-CEC 22 + - DSI 23 + - SPDIFRX 24 + - MDIO salave interface 25 + 26 + Resources 27 + --------- 28 + 29 + Datasheet and reference manual are publicly available on ST website (STM32F769_). 30 + 31 + .. _STM32F769: http://www.st.com/content/st_com/en/products/microcontrollers/stm32-32-bit-arm-cortex-mcus/stm32-high-performance-mcus/stm32f7-series/stm32f7x9/stm32f769ni.html 32 + 33 + :Authors: 34 + 35 + Alexandre Torgue <alexandre.torgue@st.com>
+34
Documentation/arm/stm32/stm32h743-overview.rst
··· 1 + STM32H743 Overview 2 + ================== 3 + 4 + Introduction 5 + ------------ 6 + 7 + The STM32H743 is a Cortex-M7 MCU aimed at various applications. 8 + It features: 9 + 10 + - Cortex-M7 core running up to @400MHz 11 + - 2MB internal flash, 1MBytes internal RAM 12 + - FMC controller to connect SDRAM, NOR and NAND memories 13 + - Dual mode QSPI 14 + - SD/MMC/SDIO support 15 + - Ethernet controller 16 + - USB OTFG FS & HS controllers 17 + - I2C, SPI, CAN busses support 18 + - Several 16 & 32 bits general purpose timers 19 + - Serial Audio interface 20 + - LCD controller 21 + - HDMI-CEC 22 + - SPDIFRX 23 + - DFSDM 24 + 25 + Resources 26 + --------- 27 + 28 + Datasheet and reference manual are publicly available on ST website (STM32H743_). 29 + 30 + .. _STM32H743: http://www.st.com/en/microcontrollers/stm32h7x3.html?querycriteria=productId=LN2033 31 + 32 + :Authors: 33 + 34 + Alexandre Torgue <alexandre.torgue@st.com>
-30
Documentation/arm/stm32/stm32h743-overview.txt
··· 1 - STM32H743 Overview 2 - ================== 3 - 4 - Introduction 5 - ------------ 6 - The STM32H743 is a Cortex-M7 MCU aimed at various applications. 7 - It features: 8 - - Cortex-M7 core running up to @400MHz 9 - - 2MB internal flash, 1MBytes internal RAM 10 - - FMC controller to connect SDRAM, NOR and NAND memories 11 - - Dual mode QSPI 12 - - SD/MMC/SDIO support 13 - - Ethernet controller 14 - - USB OTFG FS & HS controllers 15 - - I2C, SPI, CAN busses support 16 - - Several 16 & 32 bits general purpose timers 17 - - Serial Audio interface 18 - - LCD controller 19 - - HDMI-CEC 20 - - SPDIFRX 21 - - DFSDM 22 - 23 - Resources 24 - --------- 25 - Datasheet and reference manual are publicly available on ST website: 26 - - http://www.st.com/en/microcontrollers/stm32h7x3.html?querycriteria=productId=LN2033 27 - 28 - Document Author 29 - --------------- 30 - Alexandre Torgue <alexandre.torgue@st.com>
+19
Documentation/arm/stm32/stm32mp157-overview.rst
··· 1 + STM32MP157 Overview 2 + =================== 3 + 4 + Introduction 5 + ------------ 6 + 7 + The STM32MP157 is a Cortex-A MPU aimed at various applications. 8 + It features: 9 + 10 + - Dual core Cortex-A7 application core 11 + - 2D/3D image composition with GPU 12 + - Standard memories interface support 13 + - Standard connectivity, widely inherited from the STM32 MCU family 14 + - Comprehensive security support 15 + 16 + :Authors: 17 + 18 + - Ludovic Barre <ludovic.barre@st.com> 19 + - Gerald Baeza <gerald.baeza@st.com>
+1
Documentation/devicetree/bindings/arm/cpus.txt
··· 199 199 "actions,s500-smp" 200 200 "allwinner,sun6i-a31" 201 201 "allwinner,sun8i-a23" 202 + "allwinner,sun9i-a80-smp" 202 203 "amlogic,meson8-smp" 203 204 "amlogic,meson8b-smp" 204 205 "arm,realview-smp"
+16
Documentation/devicetree/bindings/arm/omap/mpu.txt
··· 13 13 Optional properties: 14 14 - sram: Phandle to the ocmcram node 15 15 16 + am335x and am437x only: 17 + - pm-sram: Phandles to ocmcram nodes to be used for power management. 18 + First should be type 'protect-exec' for the driver to use to copy 19 + and run PM functions, second should be regular pool to be used for 20 + data region for code. See Documentation/devicetree/bindings/sram/sram.txt 21 + for more details. 22 + 16 23 Examples: 17 24 18 25 - For an OMAP5 SMP system: ··· 42 35 mpu { 43 36 compatible = "ti,omap3-mpu"; 44 37 ti,hwmods = "mpu"; 38 + }; 39 + 40 + - For an AM335x system: 41 + 42 + mpu { 43 + compatible = "ti,omap3-mpu"; 44 + ti,hwmods = "mpu"; 45 + pm-sram = <&pm_sram_code 46 + &pm_sram_data>; 45 47 };
+44
Documentation/devicetree/bindings/arm/sunxi/smp-sram.txt
··· 1 + Allwinner SRAM for smp bringup: 2 + ------------------------------------------------ 3 + 4 + Allwinner's A80 SoC uses part of the secure sram for hotplugging of the 5 + primary core (cpu0). Once the core gets powered up it checks if a magic 6 + value is set at a specific location. If it is then the BROM will jump 7 + to the software entry address, instead of executing a standard boot. 8 + 9 + Therefore a reserved section sub-node has to be added to the mmio-sram 10 + declaration. 11 + 12 + Note that this is separate from the Allwinner SRAM controller found in 13 + ../../sram/sunxi-sram.txt. This SRAM is secure only and not mappable to 14 + any device. 15 + 16 + Also there are no "secure-only" properties. The implementation should 17 + check if this SRAM is usable first. 18 + 19 + Required sub-node properties: 20 + - compatible : depending on the SoC this should be one of: 21 + "allwinner,sun9i-a80-smp-sram" 22 + 23 + The rest of the properties should follow the generic mmio-sram discription 24 + found in ../../misc/sram.txt 25 + 26 + Example: 27 + 28 + sram_b: sram@20000 { 29 + /* 256 KiB secure SRAM at 0x20000 */ 30 + compatible = "mmio-sram"; 31 + reg = <0x00020000 0x40000>; 32 + #address-cells = <1>; 33 + #size-cells = <1>; 34 + ranges = <0 0x00020000 0x40000>; 35 + 36 + smp-sram@1000 { 37 + /* 38 + * This is checked by BROM to determine if 39 + * cpu0 should jump to SMP entry vector 40 + */ 41 + compatible = "allwinner,sun9i-a80-smp-sram"; 42 + reg = <0x1000 0x8>; 43 + }; 44 + };
-50
Documentation/devicetree/bindings/mtd/pxa3xx-nand.txt
··· 1 - PXA3xx NAND DT bindings 2 - 3 - Required properties: 4 - 5 - - compatible: Should be set to one of the following: 6 - marvell,pxa3xx-nand 7 - marvell,armada370-nand 8 - marvell,armada-8k-nand 9 - - reg: The register base for the controller 10 - - interrupts: The interrupt to map 11 - - #address-cells: Set to <1> if the node includes partitions 12 - - marvell,system-controller: Set to retrieve the syscon node that handles 13 - NAND controller related registers (only required 14 - with marvell,armada-8k-nand compatible). 15 - 16 - Optional properties: 17 - 18 - - dmas: dma data channel, see dma.txt binding doc 19 - - marvell,nand-enable-arbiter: Set to enable the bus arbiter 20 - - marvell,nand-keep-config: Set to keep the NAND controller config as set 21 - by the bootloader 22 - - num-cs: Number of chipselect lines to use 23 - - nand-on-flash-bbt: boolean to enable on flash bbt option if 24 - not present false 25 - - nand-ecc-strength: number of bits to correct per ECC step 26 - - nand-ecc-step-size: number of data bytes covered by a single ECC step 27 - 28 - The following ECC strength and step size are currently supported: 29 - 30 - - nand-ecc-strength = <1>, nand-ecc-step-size = <512> 31 - - nand-ecc-strength = <4>, nand-ecc-step-size = <512> 32 - - nand-ecc-strength = <8>, nand-ecc-step-size = <512> 33 - 34 - Example: 35 - 36 - nand0: nand@43100000 { 37 - compatible = "marvell,pxa3xx-nand"; 38 - reg = <0x43100000 90>; 39 - interrupts = <45>; 40 - dmas = <&pdma 97 0>; 41 - dma-names = "data"; 42 - #address-cells = <1>; 43 - 44 - marvell,nand-enable-arbiter; 45 - marvell,nand-keep-config; 46 - num-cs = <1>; 47 - 48 - /* partitions (optional) */ 49 - }; 50 -
+2
Documentation/devicetree/bindings/power/renesas,rcar-sysc.txt
··· 17 17 - "renesas,r8a7794-sysc" (R-Car E2) 18 18 - "renesas,r8a7795-sysc" (R-Car H3) 19 19 - "renesas,r8a7796-sysc" (R-Car M3-W) 20 + - "renesas,r8a77965-sysc" (R-Car M3-N) 20 21 - "renesas,r8a77970-sysc" (R-Car V3M) 22 + - "renesas,r8a77980-sysc" (R-Car V3H) 21 23 - "renesas,r8a77995-sysc" (R-Car D3) 22 24 - reg: Address start and address range for the device. 23 25 - #power-domain-cells: Must be 1.
+2
Documentation/devicetree/bindings/reset/renesas,rst.txt
··· 26 26 - "renesas,r8a7794-rst" (R-Car E2) 27 27 - "renesas,r8a7795-rst" (R-Car H3) 28 28 - "renesas,r8a7796-rst" (R-Car M3-W) 29 + - "renesas,r8a77965-rst" (R-Car M3-N) 29 30 - "renesas,r8a77970-rst" (R-Car V3M) 31 + - "renesas,r8a77980-rst" (R-Car V3H) 30 32 - "renesas,r8a77995-rst" (R-Car D3) 31 33 - reg: Address start and address range for the device. 32 34
+52 -36
MAINTAINERS
··· 1242 1242 S: Maintained 1243 1243 F: drivers/clk/at91 1244 1244 1245 - ARM/ATMEL AT91RM9200, AT91SAM9 AND SAMA5 SOC SUPPORT 1246 - M: Nicolas Ferre <nicolas.ferre@microchip.com> 1247 - M: Alexandre Belloni <alexandre.belloni@bootlin.com> 1248 - L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1249 - W: http://www.linux4sam.org 1250 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91.git 1251 - S: Supported 1252 - N: at91 1253 - N: atmel 1254 - F: arch/arm/mach-at91/ 1255 - F: include/soc/at91/ 1256 - F: arch/arm/boot/dts/at91*.dts 1257 - F: arch/arm/boot/dts/at91*.dtsi 1258 - F: arch/arm/boot/dts/sama*.dts 1259 - F: arch/arm/boot/dts/sama*.dtsi 1260 - F: arch/arm/include/debug/at91.S 1261 - F: drivers/memory/atmel* 1262 - F: drivers/watchdog/sama5d4_wdt.c 1263 - X: drivers/input/touchscreen/atmel_mxt_ts.c 1264 - X: drivers/net/wireless/atmel/ 1265 - 1266 1245 ARM/CALXEDA HIGHBANK ARCHITECTURE 1267 1246 M: Rob Herring <robh@kernel.org> 1268 1247 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) ··· 1562 1583 M: Philipp Zabel <philipp.zabel@gmail.com> 1563 1584 S: Maintained 1564 1585 1565 - ARM/Marvell Berlin SoC support 1566 - M: Jisheng Zhang <jszhang@marvell.com> 1567 - M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> 1568 - L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1569 - S: Maintained 1570 - F: arch/arm/mach-berlin/ 1571 - F: arch/arm/boot/dts/berlin* 1572 - F: arch/arm64/boot/dts/marvell/berlin* 1573 - 1574 1586 ARM/Marvell Dove/MV78xx0/Orion SOC support 1575 1587 M: Jason Cooper <jason@lakedaemon.net> 1576 1588 M: Andrew Lunn <andrew@lunn.ch> ··· 1632 1662 F: arch/arm/mach-ks8695/ 1633 1663 S: Odd Fixes 1634 1664 1665 + ARM/Microchip (AT91) SoC support 1666 + M: Nicolas Ferre <nicolas.ferre@microchip.com> 1667 + M: Alexandre Belloni <alexandre.belloni@bootlin.com> 1668 + L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1669 + W: http://www.linux4sam.org 1670 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/nferre/linux-at91.git 1671 + S: Supported 1672 + N: at91 1673 + N: atmel 1674 + F: arch/arm/mach-at91/ 1675 + F: include/soc/at91/ 1676 + F: arch/arm/boot/dts/at91*.dts 1677 + F: arch/arm/boot/dts/at91*.dtsi 1678 + F: arch/arm/boot/dts/sama*.dts 1679 + F: arch/arm/boot/dts/sama*.dtsi 1680 + F: arch/arm/include/debug/at91.S 1681 + F: drivers/memory/atmel* 1682 + F: drivers/watchdog/sama5d4_wdt.c 1683 + X: drivers/input/touchscreen/atmel_mxt_ts.c 1684 + X: drivers/net/wireless/atmel/ 1685 + 1635 1686 ARM/MIOA701 MACHINE SUPPORT 1636 1687 M: Robert Jarzmik <robert.jarzmik@free.fr> 1637 1688 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) ··· 1696 1705 F: Documentation/devicetree/bindings/arm/ste-* 1697 1706 F: Documentation/devicetree/bindings/arm/ux500/ 1698 1707 T: git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-nomadik.git 1708 + 1709 + ARM/NUVOTON NPCM ARCHITECTURE 1710 + M: Avi Fishman <avifishman70@gmail.com> 1711 + M: Tomer Maimon <tmaimon77@gmail.com> 1712 + R: Patrick Venture <venture@google.com> 1713 + R: Nancy Yuen <yuenn@google.com> 1714 + R: Brendan Higgins <brendanhiggins@google.com> 1715 + L: openbmc@lists.ozlabs.org (moderated for non-subscribers) 1716 + S: Supported 1717 + F: arch/arm/mach-npcm/ 1718 + F: arch/arm/boot/dts/nuvoton-npcm* 1719 + F: include/dt-bindings/clock/nuvoton,npcm7xx-clks.h 1720 + F: drivers/*/*npcm* 1721 + F: Documentation/*/*npcm* 1699 1722 1700 1723 ARM/NUVOTON W90X900 ARM ARCHITECTURE 1701 1724 M: Wan ZongShun <mcuos.com@gmail.com> ··· 1973 1968 S: Maintained 1974 1969 F: drivers/edac/altera_edac. 1975 1970 1971 + ARM/SPREADTRUM SoC SUPPORT 1972 + M: Orson Zhai <orsonzhai@gmail.com> 1973 + M: Baolin Wang <baolin.wang@linaro.org> 1974 + M: Chunyan Zhang <zhang.lyra@gmail.com> 1975 + S: Maintained 1976 + F: arch/arm64/boot/dts/sprd 1977 + N: sprd 1978 + 1976 1979 ARM/STI ARCHITECTURE 1977 1980 M: Patrice Chotard <patrice.chotard@st.com> 1978 1981 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) ··· 2022 2009 F: arch/arm/boot/dts/stm32* 2023 2010 F: arch/arm/mach-stm32/ 2024 2011 F: drivers/clocksource/armv7m_systick.c 2012 + 2013 + ARM/Synaptics Berlin SoC support 2014 + M: Jisheng Zhang <Jisheng.Zhang@synaptics.com> 2015 + M: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> 2016 + L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2017 + S: Maintained 2018 + F: arch/arm/mach-berlin/ 2019 + F: arch/arm/boot/dts/berlin* 2020 + F: arch/arm64/boot/dts/marvell/berlin* 2025 2021 2026 2022 ARM/TANGO ARCHITECTURE 2027 2023 M: Marc Gonzalez <marc.w.gonzalez@free.fr> ··· 11437 11415 F: include/sound/pxa2xx-lib.h 11438 11416 F: sound/arm/pxa* 11439 11417 F: sound/soc/pxa/ 11440 - 11441 - PXA3xx NAND FLASH DRIVER 11442 - M: Ezequiel Garcia <ezequiel.garcia@free-electrons.com> 11443 - L: linux-mtd@lists.infradead.org 11444 - S: Maintained 11445 - F: drivers/mtd/nand/pxa3xx_nand.c 11446 11418 11447 11419 QAT DRIVER 11448 11420 M: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
+28 -26
arch/arm/Kconfig
··· 709 709 # Kconfigs may be included either alphabetically (according to the 710 710 # plat- suffix) or along side the corresponding mach-* source. 711 711 # 712 - source "arch/arm/mach-mvebu/Kconfig" 713 - 714 712 source "arch/arm/mach-actions/Kconfig" 715 713 716 714 source "arch/arm/mach-alpine/Kconfig" ··· 716 718 source "arch/arm/mach-artpec/Kconfig" 717 719 718 720 source "arch/arm/mach-asm9260/Kconfig" 721 + 722 + source "arch/arm/mach-aspeed/Kconfig" 719 723 720 724 source "arch/arm/mach-at91/Kconfig" 721 725 ··· 739 739 740 740 source "arch/arm/mach-ep93xx/Kconfig" 741 741 742 + source "arch/arm/mach-exynos/Kconfig" 743 + source "arch/arm/plat-samsung/Kconfig" 744 + 742 745 source "arch/arm/mach-footbridge/Kconfig" 743 746 744 747 source "arch/arm/mach-gemini/Kconfig" ··· 750 747 751 748 source "arch/arm/mach-hisi/Kconfig" 752 749 750 + source "arch/arm/mach-imx/Kconfig" 751 + 753 752 source "arch/arm/mach-integrator/Kconfig" 753 + 754 + source "arch/arm/mach-iop13xx/Kconfig" 754 755 755 756 source "arch/arm/mach-iop32x/Kconfig" 756 757 757 758 source "arch/arm/mach-iop33x/Kconfig" 758 - 759 - source "arch/arm/mach-iop13xx/Kconfig" 760 759 761 760 source "arch/arm/mach-ixp4xx/Kconfig" 762 761 ··· 766 761 767 762 source "arch/arm/mach-ks8695/Kconfig" 768 763 764 + source "arch/arm/mach-mediatek/Kconfig" 765 + 769 766 source "arch/arm/mach-meson/Kconfig" 767 + 768 + source "arch/arm/mach-mmp/Kconfig" 770 769 771 770 source "arch/arm/mach-moxart/Kconfig" 772 771 773 - source "arch/arm/mach-aspeed/Kconfig" 774 - 775 772 source "arch/arm/mach-mv78xx0/Kconfig" 776 773 777 - source "arch/arm/mach-imx/Kconfig" 778 - 779 - source "arch/arm/mach-mediatek/Kconfig" 774 + source "arch/arm/mach-mvebu/Kconfig" 780 775 781 776 source "arch/arm/mach-mxs/Kconfig" 782 777 783 778 source "arch/arm/mach-netx/Kconfig" 784 779 785 780 source "arch/arm/mach-nomadik/Kconfig" 781 + 782 + source "arch/arm/mach-npcm/Kconfig" 786 783 787 784 source "arch/arm/mach-nspire/Kconfig" 788 785 ··· 796 789 797 790 source "arch/arm/mach-orion5x/Kconfig" 798 791 792 + source "arch/arm/mach-oxnas/Kconfig" 793 + 799 794 source "arch/arm/mach-picoxcell/Kconfig" 795 + 796 + source "arch/arm/mach-prima2/Kconfig" 800 797 801 798 source "arch/arm/mach-pxa/Kconfig" 802 799 source "arch/arm/plat-pxa/Kconfig" 803 - 804 - source "arch/arm/mach-mmp/Kconfig" 805 - 806 - source "arch/arm/mach-oxnas/Kconfig" 807 800 808 801 source "arch/arm/mach-qcom/Kconfig" 809 802 ··· 811 804 812 805 source "arch/arm/mach-rockchip/Kconfig" 813 806 807 + source "arch/arm/mach-s3c24xx/Kconfig" 808 + 809 + source "arch/arm/mach-s3c64xx/Kconfig" 810 + 811 + source "arch/arm/mach-s5pv210/Kconfig" 812 + 814 813 source "arch/arm/mach-sa1100/Kconfig" 814 + 815 + source "arch/arm/mach-shmobile/Kconfig" 815 816 816 817 source "arch/arm/mach-socfpga/Kconfig" 817 818 ··· 829 814 830 815 source "arch/arm/mach-stm32/Kconfig" 831 816 832 - source "arch/arm/mach-s3c24xx/Kconfig" 833 - 834 - source "arch/arm/mach-s3c64xx/Kconfig" 835 - 836 - source "arch/arm/mach-s5pv210/Kconfig" 837 - 838 - source "arch/arm/mach-exynos/Kconfig" 839 - source "arch/arm/plat-samsung/Kconfig" 840 - 841 - source "arch/arm/mach-shmobile/Kconfig" 842 - 843 817 source "arch/arm/mach-sunxi/Kconfig" 844 - 845 - source "arch/arm/mach-prima2/Kconfig" 846 818 847 819 source "arch/arm/mach-tango/Kconfig" 848 820
+1
arch/arm/Makefile
··· 196 196 machine-$(CONFIG_ARCH_MXS) += mxs 197 197 machine-$(CONFIG_ARCH_NETX) += netx 198 198 machine-$(CONFIG_ARCH_NOMADIK) += nomadik 199 + machine-$(CONFIG_ARCH_NPCM) += npcm 199 200 machine-$(CONFIG_ARCH_NSPIRE) += nspire 200 201 machine-$(CONFIG_ARCH_OXNAS) += oxnas 201 202 machine-$(CONFIG_ARCH_OMAP1) += omap1
+3 -3
arch/arm/boot/dts/pxa3xx.dtsi
··· 117 117 status = "disabled"; 118 118 }; 119 119 120 - nand0: nand@43100000 { 121 - compatible = "marvell,pxa3xx-nand"; 120 + nand_controller: nand-controller@43100000 { 121 + compatible = "marvell,pxa3xx-nand-controller"; 122 122 reg = <0x43100000 90>; 123 123 interrupts = <45>; 124 124 clocks = <&clks CLK_NAND>; 125 125 dmas = <&pdma 97 3>; 126 126 dma-names = "data"; 127 127 #address-cells = <1>; 128 - #size-cells = <1>; 128 + #size-cells = <0>; 129 129 status = "disabled"; 130 130 }; 131 131
+4
arch/arm/configs/bcm2835_defconfig
··· 49 49 CONFIG_IP_PNP_DHCP=y 50 50 CONFIG_NETWORK_SECMARK=y 51 51 CONFIG_NETFILTER=y 52 + CONFIG_BT=y 53 + CONFIG_BT_HCIUART=m 54 + CONFIG_BT_HCIUART_BCM=y 52 55 CONFIG_CFG80211=y 53 56 CONFIG_MAC80211=y 54 57 CONFIG_DEVTMPFS=y ··· 77 74 CONFIG_SERIAL_8250_BCM2835AUX=y 78 75 CONFIG_SERIAL_AMBA_PL011=y 79 76 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y 77 + CONFIG_SERIAL_DEV_BUS=y 80 78 CONFIG_TTY_PRINTK=y 81 79 CONFIG_I2C_CHARDEV=y 82 80 CONFIG_I2C_BCM2835=y
+1 -1
arch/arm/configs/cm_x300_defconfig
··· 49 49 CONFIG_MTD=y 50 50 CONFIG_MTD_BLOCK=y 51 51 CONFIG_MTD_NAND=y 52 - CONFIG_MTD_NAND_PXA3xx=y 52 + CONFIG_MTD_NAND_MARVELL=y 53 53 CONFIG_MTD_UBI=y 54 54 CONFIG_BLK_DEV_LOOP=y 55 55 CONFIG_BLK_DEV_RAM=y
+2 -1
arch/arm/configs/davinci_all_defconfig
··· 126 126 CONFIG_GPIO_PCA953X_IRQ=y 127 127 CONFIG_POWER_RESET=y 128 128 CONFIG_POWER_RESET_GPIO=y 129 + CONFIG_SYSCON_REBOOT_MODE=m 129 130 CONFIG_BATTERY_LEGO_EV3=m 130 131 CONFIG_WATCHDOG=y 131 - CONFIG_DAVINCI_WATCHDOG=m 132 + CONFIG_DAVINCI_WATCHDOG=y 132 133 CONFIG_MFD_DM355EVM_MSP=y 133 134 CONFIG_TPS6507X=y 134 135 CONFIG_REGULATOR=y
+3 -6
arch/arm/configs/imx_v4_v5_defconfig
··· 1 1 # CONFIG_SWAP is not set 2 2 CONFIG_SYSVIPC=y 3 3 CONFIG_POSIX_MQUEUE=y 4 - CONFIG_FHANDLE=y 5 4 CONFIG_NO_HZ=y 6 5 CONFIG_HIGH_RES_TIMERS=y 7 6 CONFIG_LOG_BUF_SHIFT=14 ··· 77 78 CONFIG_SMC911X=y 78 79 CONFIG_SMSC911X=y 79 80 CONFIG_SMSC_PHY=y 80 - # CONFIG_INPUT_MOUSEDEV is not set 81 81 CONFIG_INPUT_EVDEV=y 82 82 CONFIG_KEYBOARD_GPIO=y 83 83 CONFIG_KEYBOARD_IMX=y ··· 103 105 CONFIG_SENSORS_MC13783_ADC=m 104 106 CONFIG_WATCHDOG=y 105 107 CONFIG_IMX2_WDT=y 106 - CONFIG_MFD_MX25_TSADC=y 107 108 CONFIG_MFD_MC13XXX_SPI=y 109 + CONFIG_MFD_MX25_TSADC=y 108 110 CONFIG_REGULATOR=y 109 111 CONFIG_REGULATOR_FIXED_VOLTAGE=y 110 112 CONFIG_REGULATOR_GPIO=y ··· 114 116 CONFIG_MEDIA_CAMERA_SUPPORT=y 115 117 CONFIG_V4L_PLATFORM_DRIVERS=y 116 118 CONFIG_SOC_CAMERA=y 117 - CONFIG_VIDEO_MX2=y 118 119 CONFIG_V4L_MEM2MEM_DRIVERS=y 119 120 CONFIG_VIDEO_CODA=y 120 - CONFIG_SOC_CAMERA_OV2640=y 121 121 CONFIG_FB=y 122 122 CONFIG_FB_IMX=y 123 123 CONFIG_LCD_L4F00242T03=y ··· 130 134 CONFIG_SND_SOC_MX27VIS_AIC32X4=y 131 135 CONFIG_SND_SOC_PHYCORE_AC97=y 132 136 CONFIG_SND_SOC_EUKREA_TLV320=y 133 - CONFIG_SND_SOC_IMX_SGTL5000=y 134 137 CONFIG_SND_SOC_IMX_MC13783=y 138 + CONFIG_SND_SOC_FSL_ASOC_CARD=y 139 + CONFIG_SND_SOC_SGTL5000=y 135 140 CONFIG_USB_HID=m 136 141 CONFIG_USB=y 137 142 CONFIG_USB_EHCI_HCD=y
+16 -14
arch/arm/configs/imx_v6_v7_defconfig
··· 48 48 CONFIG_SMP=y 49 49 CONFIG_ARM_PSCI=y 50 50 CONFIG_PREEMPT_VOLUNTARY=y 51 - CONFIG_AEABI=y 52 51 CONFIG_HIGHMEM=y 53 - CONFIG_CMA=y 54 52 CONFIG_FORCE_MAX_ZONEORDER=14 55 53 CONFIG_CMDLINE="noinitrd console=ttymxc0,115200" 56 54 CONFIG_KEXEC=y ··· 58 60 CONFIG_CPU_FREQ_GOV_POWERSAVE=y 59 61 CONFIG_CPU_FREQ_GOV_USERSPACE=y 60 62 CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y 63 + CONFIG_CPUFREQ_DT=y 61 64 CONFIG_ARM_IMX6Q_CPUFREQ=y 62 65 CONFIG_CPU_IDLE=y 63 66 CONFIG_VFP=y ··· 80 81 CONFIG_CAN_FLEXCAN=y 81 82 CONFIG_BT=y 82 83 CONFIG_BT_HCIUART=y 83 - CONFIG_BT_HCIUART_SERDEV=y 84 84 CONFIG_BT_HCIUART_H4=y 85 85 CONFIG_BT_HCIUART_LL=y 86 86 CONFIG_CFG80211=y ··· 90 92 CONFIG_DEVTMPFS=y 91 93 CONFIG_DEVTMPFS_MOUNT=y 92 94 # CONFIG_STANDALONE is not set 93 - CONFIG_DMA_CMA=y 94 95 CONFIG_CMA_SIZE_MBYTES=64 95 96 CONFIG_IMX_WEIM=y 96 97 CONFIG_CONNECTOR=y ··· 167 170 CONFIG_INPUT_TOUCHSCREEN=y 168 171 CONFIG_TOUCHSCREEN_ADS7846=y 169 172 CONFIG_TOUCHSCREEN_EGALAX=y 173 + CONFIG_TOUCHSCREEN_MAX11801=y 170 174 CONFIG_TOUCHSCREEN_IMX6UL_TSC=y 171 175 CONFIG_TOUCHSCREEN_EDT_FT5X06=y 172 - CONFIG_TOUCHSCREEN_MAX11801=y 173 176 CONFIG_TOUCHSCREEN_MC13783=y 174 177 CONFIG_TOUCHSCREEN_TSC2004=y 175 178 CONFIG_TOUCHSCREEN_TSC2007=y ··· 178 181 CONFIG_TOUCHSCREEN_COLIBRI_VF50=y 179 182 CONFIG_INPUT_MISC=y 180 183 CONFIG_INPUT_MMA8450=y 181 - CONFIG_HID_MULTITOUCH=y 182 184 CONFIG_SERIO_SERPORT=m 183 185 # CONFIG_LEGACY_PTYS is not set 184 186 CONFIG_SERIAL_IMX=y ··· 185 189 CONFIG_SERIAL_FSL_LPUART=y 186 190 CONFIG_SERIAL_FSL_LPUART_CONSOLE=y 187 191 CONFIG_SERIAL_DEV_BUS=y 188 - CONFIG_SERIAL_DEV_CTRL_TTYPORT=y 189 192 # CONFIG_I2C_COMPAT is not set 190 193 CONFIG_I2C_CHARDEV=y 191 194 CONFIG_I2C_MUX=y ··· 204 209 CONFIG_GPIO_STMPE=y 205 210 CONFIG_GPIO_74X164=y 206 211 CONFIG_POWER_RESET=y 207 - CONFIG_POWER_RESET_IMX=y 208 212 CONFIG_POWER_RESET_SYSCON=y 209 213 CONFIG_POWER_RESET_SYSCON_POWEROFF=y 210 214 CONFIG_POWER_SUPPLY=y 211 215 CONFIG_SENSORS_GPIO_FAN=y 212 216 CONFIG_SENSORS_IIO_HWMON=y 213 - CONFIG_THERMAL=y 214 217 CONFIG_THERMAL_WRITABLE_TRIPS=y 215 218 CONFIG_CPU_THERMAL=y 216 219 CONFIG_IMX_THERMAL=y 217 220 CONFIG_WATCHDOG=y 221 + CONFIG_DA9062_WATCHDOG=y 218 222 CONFIG_IMX2_WDT=y 219 223 CONFIG_MFD_DA9052_I2C=y 224 + CONFIG_MFD_DA9062=y 220 225 CONFIG_MFD_MC13XXX_SPI=y 221 226 CONFIG_MFD_MC13XXX_I2C=y 222 227 CONFIG_MFD_STMPE=y ··· 224 229 CONFIG_REGULATOR_FIXED_VOLTAGE=y 225 230 CONFIG_REGULATOR_ANATOP=y 226 231 CONFIG_REGULATOR_DA9052=y 232 + CONFIG_REGULATOR_DA9062=y 227 233 CONFIG_REGULATOR_GPIO=y 228 234 CONFIG_REGULATOR_MC13783=y 229 235 CONFIG_REGULATOR_MC13892=y 230 236 CONFIG_REGULATOR_PFUZE100=y 231 - CONFIG_MEDIA_SUPPORT=y 232 - CONFIG_MEDIA_CAMERA_SUPPORT=y 233 237 CONFIG_RC_CORE=y 234 - CONFIG_MEDIA_CONTROLLER=y 235 - CONFIG_VIDEO_V4L2_SUBDEV_API=y 236 238 CONFIG_RC_DEVICES=y 237 239 CONFIG_IR_GPIO_CIR=y 240 + CONFIG_MEDIA_SUPPORT=y 241 + CONFIG_MEDIA_CAMERA_SUPPORT=y 242 + CONFIG_MEDIA_CONTROLLER=y 243 + CONFIG_VIDEO_V4L2_SUBDEV_API=y 238 244 CONFIG_MEDIA_USB_SUPPORT=y 239 245 CONFIG_USB_VIDEO_CLASS=m 240 246 CONFIG_V4L_PLATFORM_DRIVERS=y ··· 246 250 # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set 247 251 CONFIG_VIDEO_ADV7180=m 248 252 CONFIG_VIDEO_OV5640=m 249 - CONFIG_SOC_CAMERA_OV2640=y 250 253 CONFIG_IMX_IPUV3_CORE=y 251 254 CONFIG_DRM=y 252 255 CONFIG_DRM_PANEL_LVDS=y ··· 280 285 CONFIG_SND_SOC_IMX_SPDIF=y 281 286 CONFIG_SND_SOC_IMX_MC13783=y 282 287 CONFIG_SND_SOC_FSL_ASOC_CARD=y 288 + CONFIG_SND_SOC_AC97_CODEC=y 283 289 CONFIG_SND_SOC_CS42XX8_I2C=y 284 290 CONFIG_SND_SOC_TLV320AIC3X=y 285 291 CONFIG_SND_SOC_WM8960=y 292 + CONFIG_SND_SOC_WM8962=y 286 293 CONFIG_SND_SIMPLE_CARD=y 294 + CONFIG_HID_MULTITOUCH=y 287 295 CONFIG_USB=y 288 296 CONFIG_USB_EHCI_HCD=y 289 297 CONFIG_USB_EHCI_MXC=y ··· 352 354 CONFIG_RTC_DRV_PCF8523=y 353 355 CONFIG_RTC_DRV_PCF8563=y 354 356 CONFIG_RTC_DRV_M41T80=y 357 + CONFIG_RTC_DRV_DA9063=y 355 358 CONFIG_RTC_DRV_MC13XXX=y 356 359 CONFIG_RTC_DRV_MXC=y 357 360 CONFIG_RTC_DRV_MXC_V2=y ··· 368 369 CONFIG_IIO=y 369 370 CONFIG_IMX7D_ADC=y 370 371 CONFIG_VF610_ADC=y 372 + CONFIG_MAG3110=y 371 373 CONFIG_MPL3115=y 372 374 CONFIG_PWM=y 373 375 CONFIG_PWM_FSL_FTM=y 374 376 CONFIG_PWM_IMX=y 375 377 CONFIG_NVMEM_IMX_OCOTP=y 378 + CONFIG_TEE=y 379 + CONFIG_OPTEE=y 376 380 CONFIG_MUX_MMIO=y 377 381 CONFIG_EXT2_FS=y 378 382 CONFIG_EXT2_FS_XATTR=y
+63 -1
arch/arm/configs/multi_v7_defconfig
··· 80 80 CONFIG_MACH_SPEAR1310=y 81 81 CONFIG_MACH_SPEAR1340=y 82 82 CONFIG_ARCH_STI=y 83 + CONFIG_ARCH_STM32=y 83 84 CONFIG_ARCH_EXYNOS=y 84 85 CONFIG_EXYNOS5420_MCPM=y 85 86 CONFIG_ARCH_RENESAS=y ··· 175 174 CONFIG_CAN_BCM=y 176 175 CONFIG_CAN_DEV=y 177 176 CONFIG_CAN_AT91=m 177 + CONFIG_CAN_FLEXCAN=m 178 178 CONFIG_CAN_RCAR=m 179 179 CONFIG_CAN_XILINXCAN=y 180 180 CONFIG_CAN_MCP251X=y ··· 210 208 CONFIG_MTD_NAND_OMAP2=y 211 209 CONFIG_MTD_NAND_OMAP_BCH=y 212 210 CONFIG_MTD_NAND_ATMEL=y 211 + CONFIG_MTD_NAND_GPMI_NAND=y 213 212 CONFIG_MTD_NAND_BRCMNAND=y 214 213 CONFIG_MTD_NAND_VF610_NFC=y 215 214 CONFIG_MTD_NAND_DAVINCI=y ··· 310 307 CONFIG_INPUT_MISC=y 311 308 CONFIG_INPUT_MAX77693_HAPTIC=m 312 309 CONFIG_INPUT_MAX8997_HAPTIC=m 310 + CONFIG_INPUT_CPCAP_PWRBUTTON=m 313 311 CONFIG_INPUT_AXP20X_PEK=m 314 312 CONFIG_INPUT_ADXL34X=m 315 313 CONFIG_SERIO_AMBAKMI=y 316 314 CONFIG_SERIAL_8250=y 317 315 CONFIG_SERIAL_8250_CONSOLE=y 316 + CONFIG_SERIAL_8250_EXTENDED=y 317 + CONFIG_SERIAL_8250_SHARE_IRQ=y 318 + CONFIG_SERIAL_8250_BCM2835AUX=y 318 319 CONFIG_SERIAL_8250_DW=y 319 320 CONFIG_SERIAL_8250_EM=y 320 321 CONFIG_SERIAL_8250_MT6577=y ··· 358 351 CONFIG_SERIAL_CONEXANT_DIGICOLOR_CONSOLE=y 359 352 CONFIG_SERIAL_ST_ASC=y 360 353 CONFIG_SERIAL_ST_ASC_CONSOLE=y 354 + CONFIG_SERIAL_STM32=y 355 + CONFIG_SERIAL_STM32_CONSOLE=y 361 356 CONFIG_HVC_DRIVER=y 362 357 CONFIG_VIRTIO_CONSOLE=y 363 358 CONFIG_I2C_CHARDEV=y ··· 377 368 CONFIG_I2C_EMEV2=m 378 369 CONFIG_I2C_GPIO=m 379 370 CONFIG_I2C_EXYNOS5=y 380 - CONFIG_I2C_IMX=m 371 + CONFIG_I2C_IMX=y 381 372 CONFIG_I2C_MV64XXX=y 382 373 CONFIG_I2C_RIIC=y 383 374 CONFIG_I2C_RK3X=y ··· 447 438 CONFIG_GPIO_TPS6586X=y 448 439 CONFIG_GPIO_TPS65910=y 449 440 CONFIG_BATTERY_ACT8945A=y 441 + CONFIG_BATTERY_CPCAP=m 450 442 CONFIG_BATTERY_SBS=y 451 443 CONFIG_BATTERY_MAX17040=m 452 444 CONFIG_BATTERY_MAX17042=m 445 + CONFIG_CHARGER_CPCAP=m 453 446 CONFIG_CHARGER_MAX14577=m 454 447 CONFIG_CHARGER_MAX77693=m 455 448 CONFIG_CHARGER_MAX8997=m ··· 473 462 CONFIG_SENSORS_PWM_FAN=m 474 463 CONFIG_SENSORS_INA2XX=m 475 464 CONFIG_CPU_THERMAL=y 465 + CONFIG_BCM2835_THERMAL=m 476 466 CONFIG_BRCMSTB_THERMAL=m 467 + CONFIG_IMX_THERMAL=y 477 468 CONFIG_ROCKCHIP_THERMAL=y 478 469 CONFIG_RCAR_THERMAL=y 479 470 CONFIG_ARMADA_THERMAL=y ··· 489 476 CONFIG_AT91SAM9X_WATCHDOG=y 490 477 CONFIG_SAMA5D4_WATCHDOG=y 491 478 CONFIG_ORION_WATCHDOG=y 479 + CONFIG_RN5T618_WATCHDOG=y 492 480 CONFIG_ST_LPC_WATCHDOG=y 493 481 CONFIG_SUNXI_WATCHDOG=y 494 482 CONFIG_IMX2_WDT=y ··· 522 508 CONFIG_MFD_MAX8997=y 523 509 CONFIG_MFD_MAX8998=y 524 510 CONFIG_MFD_RK808=y 511 + CONFIG_MFD_CPCAP=y 525 512 CONFIG_MFD_PM8XXX=y 526 513 CONFIG_MFD_QCOM_RPM=y 527 514 CONFIG_MFD_SPMI_PMIC=y 515 + CONFIG_MFD_RN5T618=y 528 516 CONFIG_MFD_SEC_CORE=y 529 517 CONFIG_MFD_STMPE=y 530 518 CONFIG_MFD_PALMAS=y ··· 543 527 CONFIG_REGULATOR_AS3722=y 544 528 CONFIG_REGULATOR_AXP20X=y 545 529 CONFIG_REGULATOR_BCM590XX=y 530 + CONFIG_REGULATOR_CPCAP=y 546 531 CONFIG_REGULATOR_DA9210=y 547 532 CONFIG_REGULATOR_FAN53555=y 548 533 CONFIG_REGULATOR_RK808=y ··· 564 547 CONFIG_REGULATOR_PWM=y 565 548 CONFIG_REGULATOR_QCOM_RPM=y 566 549 CONFIG_REGULATOR_QCOM_SMD_RPM=y 550 + CONFIG_REGULATOR_RN5T618=y 567 551 CONFIG_REGULATOR_S2MPS11=y 568 552 CONFIG_REGULATOR_S5M8767=y 569 553 CONFIG_REGULATOR_TI_ABB=y ··· 635 617 CONFIG_DRM_RCAR_DU=m 636 618 CONFIG_DRM_RCAR_LVDS=y 637 619 CONFIG_DRM_SUN4I=m 620 + CONFIG_DRM_FSL_DCU=m 638 621 CONFIG_DRM_TEGRA=y 639 622 CONFIG_DRM_PANEL_SAMSUNG_LD9040=m 640 623 CONFIG_DRM_PANEL_SAMSUNG_S6E8AA0=m ··· 643 624 CONFIG_DRM_SII9234=m 644 625 CONFIG_DRM_STI=m 645 626 CONFIG_DRM_VC4=y 627 + CONFIG_DRM_ETNAVIV=m 628 + CONFIG_DRM_MXSFB=m 646 629 CONFIG_FB_ARMCLCD=y 647 630 CONFIG_FB_EFI=y 648 631 CONFIG_FB_WM8505=y ··· 695 674 CONFIG_SND_SOC_TEGRA_WM9712=m 696 675 CONFIG_SND_SOC_TEGRA_TRIMSLICE=m 697 676 CONFIG_SND_SOC_TEGRA_ALC5632=m 677 + CONFIG_SND_SOC_CPCAP=m 698 678 CONFIG_SND_SOC_TEGRA_MAX98090=m 699 679 CONFIG_SND_SOC_AK4642=m 700 680 CONFIG_SND_SOC_SGTL5000=m ··· 705 683 CONFIG_SND_SOC_STI_SAS=m 706 684 CONFIG_SND_SIMPLE_CARD=m 707 685 CONFIG_USB=y 686 + CONFIG_USB_OTG=y 708 687 CONFIG_USB_XHCI_HCD=y 709 688 CONFIG_USB_XHCI_MVEBU=y 710 689 CONFIG_USB_XHCI_RCAR=m ··· 727 704 CONFIG_USB_UAS=m 728 705 CONFIG_USB_MUSB_HDRC=m 729 706 CONFIG_USB_MUSB_SUNXI=m 707 + CONFIG_USB_MUSB_TUSB6010=m 708 + CONFIG_USB_MUSB_OMAP2PLUS=m 709 + CONFIG_USB_MUSB_AM35X=m 710 + CONFIG_USB_MUSB_DSPS=m 711 + CONFIG_USB_MUSB_UX500=m 712 + CONFIG_USB_UX500_DMA=y 713 + CONFIG_USB_INVENTRA_DMA=y 714 + CONFIG_USB_TI_CPPI41_DMA=y 715 + CONFIG_USB_TUSB_OMAP_DMA=y 730 716 CONFIG_USB_DWC3=y 731 717 CONFIG_USB_DWC2=y 732 718 CONFIG_USB_HSIC_USB3503=y ··· 744 712 CONFIG_USB_CHIPIDEA_HOST=y 745 713 CONFIG_AB8500_USB=y 746 714 CONFIG_KEYSTONE_USB_PHY=y 715 + CONFIG_NOP_USB_XCEIV=m 716 + CONFIG_AM335X_PHY_USB=m 717 + CONFIG_TWL6030_USB=m 747 718 CONFIG_USB_GPIO_VBUS=y 748 719 CONFIG_USB_ISP1301=y 749 720 CONFIG_USB_MSM_OTG=m ··· 754 719 CONFIG_USB_GADGET=y 755 720 CONFIG_USB_FSL_USB2=y 756 721 CONFIG_USB_RENESAS_USBHS_UDC=m 722 + CONFIG_USB_CONFIGFS=m 723 + CONFIG_USB_CONFIGFS_SERIAL=y 724 + CONFIG_USB_CONFIGFS_ACM=y 725 + CONFIG_USB_CONFIGFS_OBEX=y 726 + CONFIG_USB_CONFIGFS_NCM=y 727 + CONFIG_USB_CONFIGFS_ECM=y 728 + CONFIG_USB_CONFIGFS_ECM_SUBSET=y 729 + CONFIG_USB_CONFIGFS_RNDIS=y 730 + CONFIG_USB_CONFIGFS_EEM=y 731 + CONFIG_USB_CONFIGFS_MASS_STORAGE=y 732 + CONFIG_USB_CONFIGFS_F_LB_SS=y 733 + CONFIG_USB_CONFIGFS_F_FS=y 734 + CONFIG_USB_CONFIGFS_F_UAC1=y 735 + CONFIG_USB_CONFIGFS_F_UAC1_LEGACY=y 736 + CONFIG_USB_CONFIGFS_F_UAC2=y 737 + CONFIG_USB_CONFIGFS_F_MIDI=y 738 + CONFIG_USB_CONFIGFS_F_HID=y 739 + CONFIG_USB_CONFIGFS_F_UVC=y 740 + CONFIG_USB_CONFIGFS_F_PRINTER=y 757 741 CONFIG_USB_ETH=m 758 742 CONFIG_MMC=y 759 743 CONFIG_MMC_BLOCK_MINORS=16 ··· 809 755 CONFIG_NEW_LEDS=y 810 756 CONFIG_LEDS_CLASS=y 811 757 CONFIG_LEDS_CLASS_FLASH=m 758 + CONFIG_LEDS_CPCAP=m 812 759 CONFIG_LEDS_GPIO=y 813 760 CONFIG_LEDS_PWM=y 814 761 CONFIG_LEDS_MAX77693=m ··· 860 805 CONFIG_RTC_DRV_SUNXI=y 861 806 CONFIG_RTC_DRV_MV=y 862 807 CONFIG_RTC_DRV_TEGRA=y 808 + CONFIG_RTC_DRV_CPCAP=m 863 809 CONFIG_DMADEVICES=y 864 810 CONFIG_DW_DMAC=y 865 811 CONFIG_AT_HDMAC=y ··· 933 877 CONFIG_AT91_ADC=m 934 878 CONFIG_AT91_SAMA5D2_ADC=m 935 879 CONFIG_BERLIN2_ADC=m 880 + CONFIG_CPCAP_ADC=m 936 881 CONFIG_EXYNOS_ADC=m 937 882 CONFIG_VF610_ADC=m 938 883 CONFIG_XILINX_XADC=y ··· 959 902 CONFIG_PWM_STI=y 960 903 CONFIG_PWM_BCM2835=y 961 904 CONFIG_PWM_BRCMSTB=m 905 + CONFIG_PHY_DM816X_USB=m 962 906 CONFIG_OMAP_USB2=y 963 907 CONFIG_TI_PIPE3=y 908 + CONFIG_TWL4030_USB=m 964 909 CONFIG_PHY_BERLIN_USB=y 910 + CONFIG_PHY_CPCAP_USB=m 965 911 CONFIG_PHY_BERLIN_SATA=y 966 912 CONFIG_PHY_ROCKCHIP_DP=m 967 913 CONFIG_PHY_ROCKCHIP_USB=y ··· 978 918 CONFIG_PHY_TEGRA_XUSB=y 979 919 CONFIG_PHY_BRCM_SATA=y 980 920 CONFIG_NVMEM=y 921 + CONFIG_NVMEM_IMX_OCOTP=y 981 922 CONFIG_NVMEM_SUNXI_SID=y 923 + CONFIG_NVMEM_VF610_OCOTP=y 982 924 CONFIG_BCM2835_MBOX=y 983 925 CONFIG_RASPBERRYPI_FIRMWARE=y 984 926 CONFIG_EFI_VARS=m
+4 -10
arch/arm/configs/mxs_defconfig
··· 1 1 CONFIG_SYSVIPC=y 2 - CONFIG_FHANDLE=y 3 2 CONFIG_NO_HZ=y 4 3 CONFIG_HIGH_RES_TIMERS=y 5 4 CONFIG_TASKSTATS=y ··· 61 62 CONFIG_BLK_DEV_SD=y 62 63 CONFIG_NETDEVICES=y 63 64 CONFIG_ENC28J60=y 64 - CONFIG_SMSC_PHY=y 65 65 CONFIG_ICPLUS_PHY=y 66 - CONFIG_REALTEK_PHY=y 67 66 CONFIG_MICREL_PHY=y 67 + CONFIG_REALTEK_PHY=y 68 + CONFIG_SMSC_PHY=y 68 69 CONFIG_USB_USBNET=y 69 70 CONFIG_USB_NET_SMSC95XX=y 70 71 # CONFIG_WLAN is not set 71 - # CONFIG_INPUT_MOUSEDEV_PSAUX is not set 72 72 CONFIG_INPUT_EVDEV=y 73 73 # CONFIG_INPUT_KEYBOARD is not set 74 74 # CONFIG_INPUT_MOUSE is not set ··· 75 77 CONFIG_TOUCHSCREEN_MXS_LRADC=y 76 78 CONFIG_TOUCHSCREEN_TSC2007=m 77 79 # CONFIG_SERIO is not set 78 - CONFIG_DEVPTS_MULTIPLE_INSTANCES=y 79 80 # CONFIG_LEGACY_PTYS is not set 80 - # CONFIG_DEVKMEM is not set 81 81 CONFIG_SERIAL_AMBA_PL011=y 82 82 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y 83 83 CONFIG_SERIAL_MXS_AUART=y ··· 134 138 CONFIG_DMADEVICES=y 135 139 CONFIG_MXS_DMA=y 136 140 CONFIG_IIO=y 137 - CONFIG_IIO_SYSFS_TRIGGER=y 138 141 CONFIG_MXS_LRADC_ADC=y 142 + CONFIG_IIO_SYSFS_TRIGGER=y 139 143 CONFIG_PWM=y 140 144 CONFIG_PWM_MXS=y 141 - CONFIG_NVMEM=y 142 145 CONFIG_NVMEM_MXS_OCOTP=y 143 146 CONFIG_EXT4_FS=y 144 147 # CONFIG_DNOTIFY is not set ··· 167 172 CONFIG_UNUSED_SYMBOLS=y 168 173 CONFIG_MAGIC_SYSRQ=y 169 174 CONFIG_DEBUG_KERNEL=y 170 - CONFIG_LOCKUP_DETECTOR=y 171 - CONFIG_TIMER_STATS=y 175 + CONFIG_SOFTLOCKUP_DETECTOR=y 172 176 CONFIG_PROVE_LOCKING=y 173 177 CONFIG_BLK_DEV_IO_TRACE=y 174 178 CONFIG_STRICT_DEVMEM=y
+57 -39
arch/arm/configs/omap2plus_defconfig
··· 50 50 CONFIG_ARM_ERRATA_411920=y 51 51 CONFIG_PCI=y 52 52 CONFIG_PCI_MSI=y 53 - CONFIG_PCI_DRA7XX=y 54 53 CONFIG_PCI_DRA7XX_EP=y 55 54 CONFIG_PCI_ENDPOINT=y 56 55 CONFIG_PCI_ENDPOINT_CONFIGFS=y ··· 70 71 CONFIG_CPU_FREQ_GOV_USERSPACE=y 71 72 CONFIG_CPU_FREQ_GOV_CONSERVATIVE=y 72 73 CONFIG_CPUFREQ_DT=m 73 - CONFIG_ARM_TI_CPUFREQ=y 74 74 # CONFIG_ARM_OMAP2PLUS_CPUFREQ is not set 75 + CONFIG_ARM_TI_CPUFREQ=y 75 76 CONFIG_CPU_IDLE=y 77 + CONFIG_KERNEL_MODE_NEON=y 76 78 CONFIG_BINFMT_MISC=y 77 79 CONFIG_PM_DEBUG=y 78 80 CONFIG_NET=y ··· 103 103 CONFIG_BT_HCIBTUSB=m 104 104 CONFIG_BT_HCIBTSDIO=m 105 105 CONFIG_BT_HCIUART=m 106 + CONFIG_BT_HCIUART_NOKIA=m 106 107 CONFIG_BT_HCIUART_BCSP=y 107 108 CONFIG_BT_HCIUART_LL=y 108 109 CONFIG_BT_HCIUART_3WIRE=y 110 + CONFIG_BT_HCIUART_BCM=y 109 111 CONFIG_BT_HCIBCM203X=m 110 112 CONFIG_BT_HCIBPA10X=m 111 113 CONFIG_BT_HCIBFUSB=m ··· 234 232 CONFIG_INPUT_CPCAP_PWRBUTTON=m 235 233 CONFIG_INPUT_TPS65218_PWRBUTTON=m 236 234 CONFIG_INPUT_TWL4030_PWRBUTTON=m 235 + CONFIG_INPUT_UINPUT=m 237 236 CONFIG_INPUT_PALMAS_PWRBUTTON=m 237 + CONFIG_INPUT_PWM_VIBRA=m 238 238 CONFIG_SERIO=m 239 239 # CONFIG_LEGACY_PTYS is not set 240 240 CONFIG_SERIAL_8250=y ··· 248 244 CONFIG_SERIAL_8250_SHARE_IRQ=y 249 245 CONFIG_SERIAL_8250_DETECT_IRQ=y 250 246 CONFIG_SERIAL_8250_RSA=y 247 + CONFIG_SERIAL_8250_OMAP=y 251 248 CONFIG_SERIAL_OF_PLATFORM=y 252 249 CONFIG_SERIAL_OMAP=y 253 250 CONFIG_SERIAL_OMAP_CONSOLE=y 251 + CONFIG_SERIAL_DEV_BUS=y 254 252 CONFIG_I2C_CHARDEV=y 255 253 CONFIG_SPI=y 256 254 CONFIG_SPI_OMAP24XX=y ··· 297 291 CONFIG_TWL4030_WATCHDOG=m 298 292 CONFIG_MFD_CPCAP=y 299 293 CONFIG_MFD_TI_AM335X_TSCADC=m 294 + CONFIG_MFD_TI_LMU=m 300 295 CONFIG_MFD_PALMAS=y 301 296 CONFIG_MFD_TPS65217=y 302 297 CONFIG_MFD_TI_LP873X=y ··· 321 314 CONFIG_REGULATOR_TPS65218=y 322 315 CONFIG_REGULATOR_TPS65910=y 323 316 CONFIG_REGULATOR_TWL4030=y 324 - CONFIG_MEDIA_SUPPORT=m 325 - CONFIG_MEDIA_CAMERA_SUPPORT=y 326 317 CONFIG_RC_CORE=m 327 - CONFIG_MEDIA_CONTROLLER=y 328 - CONFIG_VIDEO_V4L2_SUBDEV_API=y 329 318 CONFIG_LIRC=y 330 319 CONFIG_RC_DEVICES=y 320 + CONFIG_IR_SPI=m 331 321 CONFIG_IR_RX51=m 322 + CONFIG_IR_GPIO_TX=m 323 + CONFIG_IR_PWM_TX=m 324 + CONFIG_MEDIA_SUPPORT=m 325 + CONFIG_MEDIA_CAMERA_SUPPORT=y 326 + CONFIG_MEDIA_CEC_SUPPORT=y 327 + CONFIG_MEDIA_CONTROLLER=y 328 + CONFIG_VIDEO_V4L2_SUBDEV_API=y 332 329 CONFIG_V4L_PLATFORM_DRIVERS=y 333 330 CONFIG_VIDEO_OMAP3=m 331 + CONFIG_CEC_PLATFORM_DRIVERS=y 334 332 # CONFIG_MEDIA_SUBDRV_AUTOSELECT is not set 335 333 CONFIG_VIDEO_TVP5150=m 334 + CONFIG_DRM=m 335 + CONFIG_DRM_OMAP=m 336 + CONFIG_OMAP5_DSS_HDMI=y 337 + CONFIG_OMAP2_DSS_SDI=y 338 + CONFIG_OMAP2_DSS_DSI=y 339 + CONFIG_DRM_OMAP_ENCODER_OPA362=m 340 + CONFIG_DRM_OMAP_ENCODER_TFP410=m 341 + CONFIG_DRM_OMAP_ENCODER_TPD12S015=m 342 + CONFIG_DRM_OMAP_CONNECTOR_DVI=m 343 + CONFIG_DRM_OMAP_CONNECTOR_HDMI=m 344 + CONFIG_DRM_OMAP_CONNECTOR_ANALOG_TV=m 345 + CONFIG_DRM_OMAP_PANEL_DPI=m 346 + CONFIG_DRM_OMAP_PANEL_DSI_CM=m 347 + CONFIG_DRM_OMAP_PANEL_SONY_ACX565AKM=m 348 + CONFIG_DRM_OMAP_PANEL_LGPHILIPS_LB035Q02=m 349 + CONFIG_DRM_OMAP_PANEL_SHARP_LS037V7DW01=m 350 + CONFIG_DRM_OMAP_PANEL_TPO_TD028TTEC1=m 351 + CONFIG_DRM_OMAP_PANEL_TPO_TD043MTEA1=m 352 + CONFIG_DRM_OMAP_PANEL_NEC_NL8048HL11=m 353 + CONFIG_DRM_TILCDC=m 336 354 CONFIG_FB=y 337 355 CONFIG_FIRMWARE_EDID=y 338 356 CONFIG_FB_MODE_HELPERS=y 339 357 CONFIG_FB_TILEBLITTING=y 340 - CONFIG_FB_OMAP2=m 341 - CONFIG_FB_OMAP5_DSS_HDMI=y 342 - CONFIG_FB_OMAP2_DSS_SDI=y 343 - CONFIG_FB_OMAP2_DSS_DSI=y 344 - CONFIG_FB_OMAP2_ENCODER_TFP410=m 345 - CONFIG_FB_OMAP2_ENCODER_TPD12S015=m 346 - CONFIG_FB_OMAP2_CONNECTOR_DVI=m 347 - CONFIG_FB_OMAP2_CONNECTOR_HDMI=m 348 - CONFIG_FB_OMAP2_CONNECTOR_ANALOG_TV=m 349 - CONFIG_FB_OMAP2_PANEL_DPI=m 350 - CONFIG_FB_OMAP2_PANEL_DSI_CM=m 351 - CONFIG_FB_OMAP2_PANEL_SONY_ACX565AKM=m 352 - CONFIG_FB_OMAP2_PANEL_LGPHILIPS_LB035Q02=m 353 - CONFIG_FB_OMAP2_PANEL_SHARP_LS037V7DW01=m 354 - CONFIG_FB_OMAP2_PANEL_TPO_TD028TTEC1=m 355 - CONFIG_FB_OMAP2_PANEL_TPO_TD043MTEA1=m 356 - CONFIG_FB_OMAP2_PANEL_NEC_NL8048HL11=m 357 - CONFIG_BACKLIGHT_LCD_SUPPORT=y 358 358 CONFIG_LCD_CLASS_DEVICE=y 359 359 CONFIG_LCD_PLATFORM=y 360 360 CONFIG_BACKLIGHT_CLASS_DEVICE=y ··· 370 356 CONFIG_BACKLIGHT_PANDORA=m 371 357 CONFIG_BACKLIGHT_GPIO=m 372 358 CONFIG_FRAMEBUFFER_CONSOLE=y 373 - CONFIG_FRAMEBUFFER_CONSOLE_DETECT_PRIMARY=y 374 359 CONFIG_FRAMEBUFFER_CONSOLE_ROTATION=y 375 360 CONFIG_LOGO=y 376 361 CONFIG_SOUND=m 377 362 CONFIG_SND=m 363 + CONFIG_SND_OSSEMUL=y 378 364 CONFIG_SND_MIXER_OSS=m 379 365 CONFIG_SND_PCM_OSS=m 380 366 CONFIG_SND_VERBOSE_PRINTK=y ··· 388 374 CONFIG_SND_OMAP_SOC_OMAP_TWL4030=m 389 375 CONFIG_SND_OMAP_SOC_OMAP_ABE_TWL6040=m 390 376 CONFIG_SND_OMAP_SOC_OMAP3_PANDORA=m 377 + CONFIG_SND_SOC_CPCAP=m 391 378 CONFIG_SND_SIMPLE_CARD=m 379 + CONFIG_SND_AUDIO_GRAPH_CARD=m 392 380 CONFIG_HID_GENERIC=m 393 381 CONFIG_USB_HIDDEV=y 394 382 CONFIG_USB_KBD=m ··· 401 385 CONFIG_USB_XHCI_HCD=m 402 386 CONFIG_USB_EHCI_HCD=m 403 387 CONFIG_USB_OHCI_HCD=m 404 - CONFIG_USB_WDM=m 405 388 CONFIG_USB_ACM=m 406 389 CONFIG_USB_STORAGE=m 407 390 CONFIG_USB_MUSB_HDRC=m ··· 477 462 CONFIG_DMA_OMAP=y 478 463 CONFIG_TI_EDMA=y 479 464 CONFIG_OMAP_IOMMU=y 480 - CONFIG_EXTCON=m 465 + CONFIG_REMOTEPROC=m 466 + CONFIG_OMAP_REMOTEPROC=m 467 + CONFIG_WKUP_M3_RPROC=m 468 + CONFIG_SOC_TI=y 469 + CONFIG_AMX3_PM=m 470 + CONFIG_WKUP_M3_IPC=m 481 471 CONFIG_EXTCON_PALMAS=m 482 472 CONFIG_EXTCON_USB_GPIO=m 483 473 CONFIG_TI_EMIF=m 474 + CONFIG_TI_EMIF_SRAM=m 484 475 CONFIG_IIO=m 485 476 CONFIG_IIO_SW_DEVICE=m 486 477 CONFIG_IIO_SW_TRIGGER=m ··· 501 480 CONFIG_PWM_TWL=m 502 481 CONFIG_PWM_TWL_LED=m 503 482 CONFIG_PHY_CPCAP_USB=m 483 + CONFIG_PHY_MAPPHONE_MDM6600=m 504 484 CONFIG_PHY_DM816X_USB=m 505 485 CONFIG_OMAP_USB2=m 506 486 CONFIG_TI_PIPE3=y ··· 516 494 CONFIG_VFAT_FS=y 517 495 CONFIG_TMPFS=y 518 496 CONFIG_TMPFS_POSIX_ACL=y 519 - CONFIG_CONFIGFS_FS=y 520 497 CONFIG_JFFS2_FS=y 521 498 CONFIG_JFFS2_SUMMARY=y 522 499 CONFIG_JFFS2_FS_XATTR=y ··· 536 515 CONFIG_DEBUG_INFO_DWARF4=y 537 516 CONFIG_MAGIC_SYSRQ=y 538 517 CONFIG_SCHEDSTATS=y 539 - CONFIG_TIMER_STATS=y 540 518 CONFIG_PROVE_LOCKING=y 541 519 # CONFIG_DEBUG_BUGVERBOSE is not set 542 520 CONFIG_SECURITY=y 543 521 CONFIG_CRYPTO_MICHAEL_MIC=y 522 + CONFIG_ARM_CRYPTO=y 523 + CONFIG_CRYPTO_SHA1_ARM_NEON=m 524 + CONFIG_CRYPTO_SHA256_ARM=m 525 + CONFIG_CRYPTO_SHA512_ARM=m 526 + CONFIG_CRYPTO_AES_ARM=m 527 + CONFIG_CRYPTO_AES_ARM_BS=m 528 + CONFIG_CRYPTO_GHASH_ARM_CE=m 529 + CONFIG_CRYPTO_CHACHA20_NEON=m 544 530 CONFIG_CRC_CCITT=y 545 531 CONFIG_CRC_T10DIF=y 546 532 CONFIG_CRC_ITU_T=y ··· 556 528 CONFIG_FONTS=y 557 529 CONFIG_FONT_8x8=y 558 530 CONFIG_FONT_8x16=y 559 - CONFIG_KERNEL_MODE_NEON=y 560 - CONFIG_ARM_CRYPTO=y 561 - CONFIG_CRYPTO_SHA1_ARM=m 562 - CONFIG_CRYPTO_SHA1_ARM_NEON=m 563 - CONFIG_CRYPTO_SHA256_ARM=m 564 - CONFIG_CRYPTO_SHA512_ARM=m 565 - CONFIG_CRYPTO_AES_ARM=m 566 - CONFIG_CRYPTO_AES_ARM_BS=m 567 - CONFIG_CRYPTO_CHACHA20_NEON=m 568 - CONFIG_CRYPTO_GHASH_ARM_CE=m
+93
arch/arm/configs/oxnas_v6_defconfig
··· 1 + CONFIG_SYSVIPC=y 2 + CONFIG_NO_HZ=y 3 + CONFIG_HIGH_RES_TIMERS=y 4 + CONFIG_CGROUPS=y 5 + CONFIG_BLK_DEV_INITRD=y 6 + CONFIG_EMBEDDED=y 7 + CONFIG_PERF_EVENTS=y 8 + CONFIG_STRICT_KERNEL_RWX=y 9 + CONFIG_STRICT_MODULE_RWX=y 10 + CONFIG_MODULES=y 11 + CONFIG_MODULE_UNLOAD=y 12 + CONFIG_PARTITION_ADVANCED=y 13 + CONFIG_CMDLINE_PARTITION=y 14 + CONFIG_ARCH_MULTI_V6=y 15 + CONFIG_ARCH_OXNAS=y 16 + CONFIG_MACH_OX820=y 17 + CONFIG_SMP=y 18 + CONFIG_NR_CPUS=16 19 + CONFIG_CMA=y 20 + CONFIG_FORCE_MAX_ZONEORDER=12 21 + CONFIG_SECCOMP=y 22 + CONFIG_ARM_APPENDED_DTB=y 23 + CONFIG_ARM_ATAG_DTB_COMPAT=y 24 + CONFIG_KEXEC=y 25 + CONFIG_EFI=y 26 + CONFIG_CPU_IDLE=y 27 + CONFIG_ARM_CPUIDLE=y 28 + CONFIG_VFP=y 29 + CONFIG_NET=y 30 + CONFIG_PACKET=y 31 + CONFIG_UNIX=y 32 + CONFIG_INET=y 33 + CONFIG_IP_PNP=y 34 + CONFIG_IP_PNP_DHCP=y 35 + CONFIG_IP_PNP_BOOTP=y 36 + CONFIG_IP_PNP_RARP=y 37 + CONFIG_IPV6_ROUTER_PREF=y 38 + CONFIG_IPV6_OPTIMISTIC_DAD=y 39 + CONFIG_INET6_AH=m 40 + CONFIG_INET6_ESP=m 41 + CONFIG_INET6_IPCOMP=m 42 + CONFIG_IPV6_MIP6=m 43 + CONFIG_IPV6_TUNNEL=m 44 + CONFIG_IPV6_MULTIPLE_TABLES=y 45 + CONFIG_DEVTMPFS=y 46 + CONFIG_DEVTMPFS_MOUNT=y 47 + CONFIG_DMA_CMA=y 48 + CONFIG_CMA_SIZE_MBYTES=64 49 + CONFIG_SIMPLE_PM_BUS=y 50 + CONFIG_MTD=y 51 + CONFIG_MTD_CMDLINE_PARTS=y 52 + CONFIG_MTD_BLOCK=y 53 + CONFIG_MTD_NAND=y 54 + CONFIG_MTD_NAND_OXNAS=y 55 + CONFIG_MTD_UBI=y 56 + CONFIG_BLK_DEV_LOOP=y 57 + CONFIG_BLK_DEV_RAM=y 58 + CONFIG_BLK_DEV_RAM_SIZE=65536 59 + CONFIG_NETDEVICES=y 60 + CONFIG_STMMAC_ETH=y 61 + CONFIG_REALTEK_PHY=y 62 + CONFIG_INPUT_EVDEV=y 63 + CONFIG_SERIAL_8250=y 64 + CONFIG_SERIAL_8250_CONSOLE=y 65 + CONFIG_SERIAL_OF_PLATFORM=y 66 + CONFIG_GPIO_GENERIC_PLATFORM=y 67 + CONFIG_NEW_LEDS=y 68 + CONFIG_LEDS_CLASS=y 69 + CONFIG_LEDS_CLASS_FLASH=m 70 + CONFIG_LEDS_GPIO=y 71 + CONFIG_LEDS_TRIGGERS=y 72 + CONFIG_LEDS_TRIGGER_TIMER=y 73 + CONFIG_LEDS_TRIGGER_ONESHOT=y 74 + CONFIG_LEDS_TRIGGER_HEARTBEAT=y 75 + CONFIG_LEDS_TRIGGER_CPU=y 76 + CONFIG_LEDS_TRIGGER_GPIO=y 77 + CONFIG_LEDS_TRIGGER_DEFAULT_ON=y 78 + CONFIG_ARM_TIMER_SP804=y 79 + CONFIG_EXT4_FS=y 80 + CONFIG_MSDOS_FS=y 81 + CONFIG_VFAT_FS=y 82 + CONFIG_TMPFS=y 83 + CONFIG_TMPFS_POSIX_ACL=y 84 + CONFIG_UBIFS_FS=y 85 + CONFIG_PSTORE=y 86 + CONFIG_PSTORE_CONSOLE=y 87 + CONFIG_PSTORE_PMSG=y 88 + CONFIG_PSTORE_RAM=y 89 + CONFIG_NLS_CODEPAGE_437=y 90 + CONFIG_NLS_ISO8859_1=y 91 + CONFIG_NLS_UTF8=y 92 + CONFIG_PRINTK_TIME=y 93 + CONFIG_MAGIC_SYSRQ=y
+1 -2
arch/arm/configs/pxa3xx_defconfig
··· 32 32 CONFIG_MTD=y 33 33 CONFIG_MTD_BLOCK=y 34 34 CONFIG_MTD_NAND=y 35 - CONFIG_MTD_NAND_PXA3xx=y 36 - CONFIG_MTD_NAND_PXA3xx_BUILTIN=y 35 + CONFIG_MTD_NAND_MARVELL=y 37 36 CONFIG_MTD_ONENAND=y 38 37 CONFIG_MTD_ONENAND_VERIFY_WRITE=y 39 38 CONFIG_MTD_ONENAND_GENERIC=y
+1 -1
arch/arm/configs/pxa_defconfig
··· 197 197 CONFIG_MTD_NAND_DISKONCHIP_PROBE_HIGH=y 198 198 CONFIG_MTD_NAND_DISKONCHIP_BBTWRITE=y 199 199 CONFIG_MTD_NAND_SHARPSL=m 200 - CONFIG_MTD_NAND_PXA3xx=m 200 + CONFIG_MTD_NAND_MARVELL=m 201 201 CONFIG_MTD_NAND_CM_X270=m 202 202 CONFIG_MTD_NAND_TMIO=m 203 203 CONFIG_MTD_NAND_BRCMNAND=m
+1 -1
arch/arm/configs/raumfeld_defconfig
··· 33 33 CONFIG_NFTL_RW=y 34 34 CONFIG_MTD_BLOCK2MTD=y 35 35 CONFIG_MTD_NAND=y 36 - CONFIG_MTD_NAND_PXA3xx=y 36 + CONFIG_MTD_NAND_MARVELL=y 37 37 CONFIG_MTD_UBI=y 38 38 CONFIG_BLK_DEV_LOOP=y 39 39 CONFIG_ISL29003=y
+10 -11
arch/arm/configs/realview_defconfig
··· 11 11 # CONFIG_IOSCHED_CFQ is not set 12 12 CONFIG_ARCH_MULTI_V6=y 13 13 CONFIG_ARCH_REALVIEW=y 14 - CONFIG_REALVIEW_DT=y 15 14 CONFIG_MACH_REALVIEW_EB=y 16 15 CONFIG_REALVIEW_EB_ARM1136=y 17 16 CONFIG_REALVIEW_EB_ARM1176=y 18 17 CONFIG_REALVIEW_EB_A9MP=y 19 18 CONFIG_REALVIEW_EB_ARM11MP=y 20 - CONFIG_REALVIEW_EB_ARM11MP_REVB=y 21 19 CONFIG_MACH_REALVIEW_PB11MP=y 22 20 CONFIG_MACH_REALVIEW_PB1176=y 23 21 CONFIG_MACH_REALVIEW_PBA8=y 24 22 CONFIG_MACH_REALVIEW_PBX=y 25 23 CONFIG_SMP=y 26 - CONFIG_AEABI=y 24 + CONFIG_CMA=y 27 25 CONFIG_ZBOOT_ROM_TEXT=0x0 28 26 CONFIG_ZBOOT_ROM_BSS=0x0 29 27 CONFIG_CMDLINE="root=/dev/nfs nfsroot=10.1.69.3:/work/nfsroot ip=dhcp console=ttyAMA0 mem=128M" ··· 44 46 CONFIG_MTD_CFI_AMDSTD=y 45 47 CONFIG_MTD_ROM=y 46 48 CONFIG_MTD_PHYSMAP=y 47 - CONFIG_ARM_CHARLCD=y 49 + CONFIG_MTD_PHYSMAP_OF=y 48 50 CONFIG_SCSI=y 49 51 CONFIG_BLK_DEV_SD=y 50 52 CONFIG_NETDEVICES=y ··· 57 59 CONFIG_SERIAL_AMBA_PL011=y 58 60 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y 59 61 # CONFIG_HW_RANDOM is not set 60 - CONFIG_I2C=y 61 62 CONFIG_I2C_VERSATILE=y 62 63 CONFIG_SPI=y 63 64 CONFIG_GPIOLIB=y 64 65 # CONFIG_HWMON is not set 65 - CONFIG_FB=y 66 - CONFIG_FB_ARMCLCD=y 67 - CONFIG_FRAMEBUFFER_CONSOLE=y 66 + CONFIG_DRM=y 67 + CONFIG_DRM_PANEL_SIMPLE=y 68 + CONFIG_DRM_PL111=y 69 + CONFIG_FB_MODE_HELPERS=y 70 + CONFIG_BACKLIGHT_LCD_SUPPORT=y 71 + CONFIG_BACKLIGHT_CLASS_DEVICE=y 68 72 CONFIG_LOGO=y 69 73 # CONFIG_LOGO_LINUX_MONO is not set 70 74 # CONFIG_LOGO_LINUX_VGA16 is not set 71 75 CONFIG_SOUND=y 72 76 CONFIG_SND=y 73 - CONFIG_SND_MIXER_OSS=y 74 - CONFIG_SND_PCM_OSS=y 75 77 # CONFIG_SND_DRIVERS is not set 76 78 CONFIG_SND_ARMAACI=y 77 79 CONFIG_USB=y ··· 81 83 CONFIG_MMC_ARMMMCI=y 82 84 CONFIG_NEW_LEDS=y 83 85 CONFIG_LEDS_CLASS=y 84 - CONFIG_LEDS_VERSATILE=y 85 86 CONFIG_LEDS_TRIGGERS=y 86 87 CONFIG_LEDS_TRIGGER_HEARTBEAT=y 87 88 CONFIG_LEDS_TRIGGER_CPU=y 88 89 CONFIG_RTC_CLASS=y 89 90 CONFIG_RTC_DRV_DS1307=y 90 91 CONFIG_RTC_DRV_PL031=y 92 + CONFIG_AUXDISPLAY=y 93 + CONFIG_ARM_CHARLCD=y 91 94 CONFIG_VFAT_FS=y 92 95 CONFIG_TMPFS=y 93 96 CONFIG_CRAMFS=y
+2 -7
arch/arm/configs/shmobile_defconfig
··· 5 5 CONFIG_CGROUPS=y 6 6 CONFIG_BLK_DEV_INITRD=y 7 7 CONFIG_CC_OPTIMIZE_FOR_SIZE=y 8 - CONFIG_SYSCTL_SYSCALL=y 9 - CONFIG_EMBEDDED=y 10 8 CONFIG_PERF_EVENTS=y 11 9 CONFIG_SLAB=y 12 10 CONFIG_ARCH_RENESAS=y ··· 32 34 CONFIG_SCHED_MC=y 33 35 CONFIG_HAVE_ARM_ARCH_TIMER=y 34 36 CONFIG_NR_CPUS=8 35 - CONFIG_AEABI=y 36 37 CONFIG_HIGHMEM=y 37 38 CONFIG_CMA=y 38 39 CONFIG_ZBOOT_ROM_TEXT=0x0 ··· 101 104 CONFIG_SERIAL_8250_CONSOLE=y 102 105 CONFIG_SERIAL_8250_EM=y 103 106 CONFIG_SERIAL_SH_SCI=y 104 - CONFIG_SERIAL_SH_SCI_NR_UARTS=20 105 - CONFIG_SERIAL_SH_SCI_CONSOLE=y 106 - CONFIG_SERIAL_SH_SCI_DMA=y 107 107 CONFIG_I2C_CHARDEV=y 108 108 CONFIG_I2C_MUX=y 109 109 CONFIG_I2C_DEMUX_PINCTRL=y ··· 114 120 CONFIG_SPI_RSPI=y 115 121 CONFIG_SPI_SH_MSIOF=y 116 122 CONFIG_SPI_SH_HSPI=y 123 + CONFIG_PINCTRL_RZA1=y 117 124 CONFIG_GPIO_EM=y 118 125 CONFIG_GPIO_RCAR=y 119 126 CONFIG_GPIO_PCF857X=y ··· 161 166 # CONFIG_BACKLIGHT_GENERIC is not set 162 167 CONFIG_BACKLIGHT_PWM=y 163 168 CONFIG_BACKLIGHT_AS3711=y 164 - CONFIG_FRAMEBUFFER_CONSOLE=y 165 169 CONFIG_SOUND=y 166 170 CONFIG_SND=y 167 171 CONFIG_SND_SOC=y ··· 221 227 CONFIG_PRINTK_TIME=y 222 228 # CONFIG_ENABLE_WARN_DEPRECATED is not set 223 229 # CONFIG_ENABLE_MUST_CHECK is not set 230 + CONFIG_DEBUG_KERNEL=y 224 231 # CONFIG_ARM_UNWIND is not set
+3
arch/arm/configs/stm32_defconfig
··· 57 57 CONFIG_REGULATOR=y 58 58 CONFIG_REGULATOR_FIXED_VOLTAGE=y 59 59 # CONFIG_USB_SUPPORT is not set 60 + CONFIG_MMC=y 61 + CONFIG_MMC_ARMMMCI=y 60 62 CONFIG_NEW_LEDS=y 61 63 CONFIG_LEDS_CLASS=y 62 64 CONFIG_LEDS_GPIO=y ··· 73 71 CONFIG_IIO=y 74 72 CONFIG_STM32_ADC_CORE=y 75 73 CONFIG_STM32_ADC=y 74 + CONFIG_EXT3_FS=y 76 75 # CONFIG_FILE_LOCKING is not set 77 76 # CONFIG_DNOTIFY is not set 78 77 # CONFIG_INOTIFY_USER is not set
+11 -7
arch/arm/configs/versatile_defconfig
··· 12 12 CONFIG_ARCH_VERSATILE=y 13 13 CONFIG_AEABI=y 14 14 CONFIG_OABI_COMPAT=y 15 + CONFIG_CMA=y 15 16 CONFIG_ZBOOT_ROM_TEXT=0x0 16 17 CONFIG_ZBOOT_ROM_BSS=0x0 17 18 CONFIG_CMDLINE="root=1f03 mem=32M" ··· 33 32 CONFIG_MTD_CFI=y 34 33 CONFIG_MTD_CFI_ADV_OPTIONS=y 35 34 CONFIG_MTD_CFI_INTELEXT=y 35 + CONFIG_MTD_CFI_AMDSTD=y 36 36 CONFIG_MTD_PHYSMAP=y 37 + CONFIG_MTD_PHYSMAP_OF=y 37 38 CONFIG_BLK_DEV_RAM=y 38 39 CONFIG_EEPROM_LEGACY=m 39 40 CONFIG_NETDEVICES=y ··· 50 47 CONFIG_SERIAL_8250_RSA=y 51 48 CONFIG_SERIAL_AMBA_PL011=y 52 49 CONFIG_SERIAL_AMBA_PL011_CONSOLE=y 53 - CONFIG_I2C=y 54 50 CONFIG_I2C_CHARDEV=m 55 51 CONFIG_I2C_VERSATILE=y 56 52 CONFIG_SPI=y 57 53 CONFIG_GPIOLIB=y 58 54 CONFIG_GPIO_PL061=y 59 55 # CONFIG_HWMON is not set 60 - CONFIG_MFD_SYSCON=y 61 - CONFIG_FB=y 62 - CONFIG_FB_ARMCLCD=y 63 - CONFIG_FRAMEBUFFER_CONSOLE=y 56 + CONFIG_DRM=y 57 + CONFIG_DRM_PANEL_ARM_VERSATILE=y 58 + CONFIG_DRM_PANEL_SIMPLE=y 59 + CONFIG_DRM_PL111=y 60 + CONFIG_FB_MODE_HELPERS=y 61 + CONFIG_BACKLIGHT_LCD_SUPPORT=y 62 + CONFIG_BACKLIGHT_CLASS_DEVICE=y 63 + CONFIG_LOGO=y 64 64 CONFIG_SOUND=y 65 65 CONFIG_SND=m 66 - CONFIG_SND_MIXER_OSS=m 67 - CONFIG_SND_PCM_OSS=m 68 66 CONFIG_SND_ARMAACI=m 69 67 CONFIG_MMC=y 70 68 CONFIG_MMC_ARMMMCI=y
+2 -5
arch/arm/include/debug/exynos.S
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 1 2 /* 2 3 * Copyright (c) 2010-2011 Samsung Electronics Co., Ltd. 3 4 * http://www.samsung.com 4 - * 5 - * This program is free software; you can redistribute it and/or modify 6 - * it under the terms of the GNU General Public License version 2 as 7 - * published by the Free Software Foundation. 8 - */ 5 + */ 9 6 10 7 /* pull in the relevant register and map files. */ 11 8
+3 -7
arch/arm/include/debug/samsung.S
··· 1 - /* arch/arm/plat-samsung/include/plat/debug-macro.S 2 - * 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 3 * Copyright 2005, 2007 Simtec Electronics 4 4 * http://armlinux.simtec.co.uk/ 5 5 * Ben Dooks <ben@simtec.co.uk> 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 - */ 6 + */ 11 7 12 8 #include <linux/serial_s3c.h> 13 9
+7 -7
arch/arm/mach-at91/Kconfig
··· 1 1 menuconfig ARCH_AT91 2 - bool "Atmel SoCs" 2 + bool "AT91/Microchip SoCs" 3 3 depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 || ARCH_MULTI_V7 || ARM_SINGLE_ARMV7M 4 4 select ARM_CPU_SUSPEND if PM && ARCH_MULTI_V7 5 5 select COMMON_CLK_AT91 ··· 13 13 select COMMON_CLK_AT91 14 14 select PINCTRL_AT91 15 15 help 16 - Select this if you are using an SoC from Atmel's SAME7, SAMS7 or SAMV7 16 + Select this if you are using an SoC from Microchip's SAME7, SAMS7 or SAMV7 17 17 families. 18 18 19 19 config SOC_SAMA5D2 ··· 29 29 select HAVE_AT91_AUDIO_PLL 30 30 select PINCTRL_AT91PIO4 31 31 help 32 - Select this if ou are using one of Atmel's SAMA5D2 family SoC. 32 + Select this if ou are using one of Microchip's SAMA5D2 family SoC. 33 33 34 34 config SOC_SAMA5D3 35 35 bool "SAMA5D3 family" ··· 41 41 select HAVE_AT91_USB_CLK 42 42 select PINCTRL_AT91 43 43 help 44 - Select this if you are using one of Atmel's SAMA5D3 family SoC. 44 + Select this if you are using one of Microchip's SAMA5D3 family SoC. 45 45 This support covers SAMA5D31, SAMA5D33, SAMA5D34, SAMA5D35, SAMA5D36. 46 46 47 47 config SOC_SAMA5D4 ··· 56 56 select HAVE_AT91_H32MX 57 57 select PINCTRL_AT91 58 58 help 59 - Select this if you are using one of Atmel's SAMA5D4 family SoC. 59 + Select this if you are using one of Microchip's SAMA5D4 family SoC. 60 60 61 61 config SOC_AT91RM9200 62 62 bool "AT91RM9200" ··· 70 70 select SOC_SAM_V4_V5 71 71 select SRAM if PM 72 72 help 73 - Select this if you are using Atmel's AT91RM9200 SoC. 73 + Select this if you are using Microchip's AT91RM9200 SoC. 74 74 75 75 config SOC_AT91SAM9 76 76 bool "AT91SAM9" ··· 88 88 select SOC_SAM_V4_V5 89 89 select SRAM if PM 90 90 help 91 - Select this if you are using one of those Atmel SoC: 91 + Select this if you are using one of those Microchip SoC: 92 92 AT91SAM9260 93 93 AT91SAM9261 94 94 AT91SAM9263
+15 -20
arch/arm/mach-davinci/board-da830-evm.c
··· 239 239 } 240 240 } 241 241 242 - /* 243 - * UI board NAND/NOR flashes only use 8-bit data bus. 244 - */ 245 - static const short da830_evm_emif25_pins[] = { 246 - DA830_EMA_D_0, DA830_EMA_D_1, DA830_EMA_D_2, DA830_EMA_D_3, 247 - DA830_EMA_D_4, DA830_EMA_D_5, DA830_EMA_D_6, DA830_EMA_D_7, 248 - DA830_EMA_A_0, DA830_EMA_A_1, DA830_EMA_A_2, DA830_EMA_A_3, 249 - DA830_EMA_A_4, DA830_EMA_A_5, DA830_EMA_A_6, DA830_EMA_A_7, 250 - DA830_EMA_A_8, DA830_EMA_A_9, DA830_EMA_A_10, DA830_EMA_A_11, 251 - DA830_EMA_A_12, DA830_EMA_BA_0, DA830_EMA_BA_1, DA830_NEMA_WE, 252 - DA830_NEMA_CS_2, DA830_NEMA_CS_3, DA830_NEMA_OE, DA830_EMA_WAIT_0, 253 - -1 254 - }; 255 - 256 242 #define HAS_MMC IS_ENABLED(CONFIG_MMC_DAVINCI) 257 243 258 244 #ifdef CONFIG_DA830_UI_NAND ··· 341 355 }, 342 356 .num_resources = ARRAY_SIZE(da830_evm_nand_resources), 343 357 .resource = da830_evm_nand_resources, 358 + }; 359 + 360 + /* 361 + * UI board NAND/NOR flashes only use 8-bit data bus. 362 + */ 363 + static const short da830_evm_emif25_pins[] = { 364 + DA830_EMA_D_0, DA830_EMA_D_1, DA830_EMA_D_2, DA830_EMA_D_3, 365 + DA830_EMA_D_4, DA830_EMA_D_5, DA830_EMA_D_6, DA830_EMA_D_7, 366 + DA830_EMA_A_0, DA830_EMA_A_1, DA830_EMA_A_2, DA830_EMA_A_3, 367 + DA830_EMA_A_4, DA830_EMA_A_5, DA830_EMA_A_6, DA830_EMA_A_7, 368 + DA830_EMA_A_8, DA830_EMA_A_9, DA830_EMA_A_10, DA830_EMA_A_11, 369 + DA830_EMA_A_12, DA830_EMA_BA_0, DA830_EMA_BA_1, DA830_NEMA_WE, 370 + DA830_NEMA_CS_2, DA830_NEMA_CS_3, DA830_NEMA_OE, DA830_EMA_WAIT_0, 371 + -1 344 372 }; 345 373 346 374 static inline void da830_evm_init_nand(int mux_mode) ··· 551 551 struct davinci_soc_info *soc_info = &davinci_soc_info; 552 552 int ret; 553 553 554 - ret = da8xx_register_cfgchip(); 555 - if (ret) 556 - pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret); 557 - 558 554 ret = da830_register_gpio(); 559 555 if (ret) 560 556 pr_warn("%s: GPIO init failed: %d\n", __func__, ret); ··· 634 638 .atag_offset = 0x100, 635 639 .map_io = da830_evm_map_io, 636 640 .init_irq = cp_intc_init, 637 - .init_time = davinci_timer_init, 641 + .init_time = da830_init_time, 638 642 .init_machine = da830_evm_init, 639 643 .init_late = davinci_init_late, 640 644 .dma_zone_size = SZ_128M, 641 - .restart = da8xx_restart, 642 645 MACHINE_END
+1 -6
arch/arm/mach-davinci/board-da850-evm.c
··· 1334 1334 { 1335 1335 int ret; 1336 1336 1337 - ret = da8xx_register_cfgchip(); 1338 - if (ret) 1339 - pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret); 1340 - 1341 1337 ret = da850_register_gpio(); 1342 1338 if (ret) 1343 1339 pr_warn("%s: GPIO init failed: %d\n", __func__, ret); ··· 1477 1481 .atag_offset = 0x100, 1478 1482 .map_io = da850_evm_map_io, 1479 1483 .init_irq = cp_intc_init, 1480 - .init_time = davinci_timer_init, 1484 + .init_time = da850_init_time, 1481 1485 .init_machine = da850_evm_init, 1482 1486 .init_late = davinci_init_late, 1483 1487 .dma_zone_size = SZ_128M, 1484 - .restart = da8xx_restart, 1485 1488 .reserve = da8xx_rproc_reserve_cma, 1486 1489 MACHINE_END
+1 -2
arch/arm/mach-davinci/board-dm355-evm.c
··· 427 427 .atag_offset = 0x100, 428 428 .map_io = dm355_evm_map_io, 429 429 .init_irq = davinci_irq_init, 430 - .init_time = davinci_timer_init, 430 + .init_time = dm355_init_time, 431 431 .init_machine = dm355_evm_init, 432 432 .init_late = davinci_init_late, 433 433 .dma_zone_size = SZ_128M, 434 - .restart = davinci_restart, 435 434 MACHINE_END
+1 -2
arch/arm/mach-davinci/board-dm355-leopard.c
··· 271 271 .atag_offset = 0x100, 272 272 .map_io = dm355_leopard_map_io, 273 273 .init_irq = davinci_irq_init, 274 - .init_time = davinci_timer_init, 274 + .init_time = dm355_init_time, 275 275 .init_machine = dm355_leopard_init, 276 276 .init_late = davinci_init_late, 277 277 .dma_zone_size = SZ_128M, 278 - .restart = davinci_restart, 279 278 MACHINE_END
+1 -2
arch/arm/mach-davinci/board-dm365-evm.c
··· 774 774 .atag_offset = 0x100, 775 775 .map_io = dm365_evm_map_io, 776 776 .init_irq = davinci_irq_init, 777 - .init_time = davinci_timer_init, 777 + .init_time = dm365_init_time, 778 778 .init_machine = dm365_evm_init, 779 779 .init_late = davinci_init_late, 780 780 .dma_zone_size = SZ_128M, 781 - .restart = davinci_restart, 782 781 MACHINE_END 783 782
+1 -2
arch/arm/mach-davinci/board-dm644x-evm.c
··· 828 828 .atag_offset = 0x100, 829 829 .map_io = davinci_evm_map_io, 830 830 .init_irq = davinci_irq_init, 831 - .init_time = davinci_timer_init, 831 + .init_time = dm644x_init_time, 832 832 .init_machine = davinci_evm_init, 833 833 .init_late = davinci_init_late, 834 834 .dma_zone_size = SZ_128M, 835 - .restart = davinci_restart, 836 835 MACHINE_END
+13 -8
arch/arm/mach-davinci/board-dm646x-evm.c
··· 44 44 #include <mach/common.h> 45 45 #include <mach/irqs.h> 46 46 #include <mach/serial.h> 47 - #include <mach/clock.h> 48 47 49 48 #include "davinci.h" 50 - #include "clock.h" 51 49 52 50 #define NAND_BLOCK_SIZE SZ_128K 53 51 ··· 714 716 } 715 717 #endif 716 718 719 + #define DM646X_REF_FREQ 27000000 720 + #define DM646X_AUX_FREQ 24000000 717 721 #define DM6467T_EVM_REF_FREQ 33000000 718 722 719 723 static void __init davinci_map_io(void) 720 724 { 721 725 dm646x_init(); 726 + } 722 727 723 - if (machine_is_davinci_dm6467tevm()) 724 - davinci_set_refclk_rate(DM6467T_EVM_REF_FREQ); 728 + static void __init dm646x_evm_init_time(void) 729 + { 730 + dm646x_init_time(DM646X_REF_FREQ, DM646X_AUX_FREQ); 731 + } 732 + 733 + static void __init dm6467t_evm_init_time(void) 734 + { 735 + dm646x_init_time(DM6467T_EVM_REF_FREQ, DM646X_AUX_FREQ); 725 736 } 726 737 727 738 #define DM646X_EVM_PHY_ID "davinci_mdio-0:01" ··· 804 797 .atag_offset = 0x100, 805 798 .map_io = davinci_map_io, 806 799 .init_irq = davinci_irq_init, 807 - .init_time = davinci_timer_init, 800 + .init_time = dm646x_evm_init_time, 808 801 .init_machine = evm_init, 809 802 .init_late = davinci_init_late, 810 803 .dma_zone_size = SZ_128M, 811 - .restart = davinci_restart, 812 804 MACHINE_END 813 805 814 806 MACHINE_START(DAVINCI_DM6467TEVM, "DaVinci DM6467T EVM") 815 807 .atag_offset = 0x100, 816 808 .map_io = davinci_map_io, 817 809 .init_irq = davinci_irq_init, 818 - .init_time = davinci_timer_init, 810 + .init_time = dm6467t_evm_init_time, 819 811 .init_machine = evm_init, 820 812 .init_late = davinci_init_late, 821 813 .dma_zone_size = SZ_128M, 822 - .restart = davinci_restart, 823 814 MACHINE_END 824 815
+1 -6
arch/arm/mach-davinci/board-mityomapl138.c
··· 502 502 { 503 503 int ret; 504 504 505 - ret = da8xx_register_cfgchip(); 506 - if (ret) 507 - pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret); 508 - 509 505 /* for now, no special EDMA channels are reserved */ 510 506 ret = da850_register_edma(NULL); 511 507 if (ret) ··· 566 570 .atag_offset = 0x100, 567 571 .map_io = mityomapl138_map_io, 568 572 .init_irq = cp_intc_init, 569 - .init_time = davinci_timer_init, 573 + .init_time = da850_init_time, 570 574 .init_machine = mityomapl138_init, 571 575 .init_late = davinci_init_late, 572 576 .dma_zone_size = SZ_128M, 573 - .restart = da8xx_restart, 574 577 MACHINE_END
+1 -2
arch/arm/mach-davinci/board-neuros-osd2.c
··· 227 227 .atag_offset = 0x100, 228 228 .map_io = davinci_ntosd2_map_io, 229 229 .init_irq = davinci_irq_init, 230 - .init_time = davinci_timer_init, 230 + .init_time = dm644x_init_time, 231 231 .init_machine = davinci_ntosd2_init, 232 232 .init_late = davinci_init_late, 233 233 .dma_zone_size = SZ_128M, 234 - .restart = davinci_restart, 235 234 MACHINE_END
+1 -6
arch/arm/mach-davinci/board-omapl138-hawk.c
··· 281 281 { 282 282 int ret; 283 283 284 - ret = da8xx_register_cfgchip(); 285 - if (ret) 286 - pr_warn("%s: CFGCHIP registration failed: %d\n", __func__, ret); 287 - 288 284 ret = da850_register_gpio(); 289 285 if (ret) 290 286 pr_warn("%s: GPIO init failed: %d\n", __func__, ret); ··· 330 334 .atag_offset = 0x100, 331 335 .map_io = omapl138_hawk_map_io, 332 336 .init_irq = cp_intc_init, 333 - .init_time = davinci_timer_init, 337 + .init_time = da850_init_time, 334 338 .init_machine = omapl138_hawk_init, 335 339 .init_late = davinci_init_late, 336 340 .dma_zone_size = SZ_128M, 337 - .restart = da8xx_restart, 338 341 .reserve = da8xx_rproc_reserve_cma, 339 342 MACHINE_END
+1 -2
arch/arm/mach-davinci/board-sffsdr.c
··· 150 150 .atag_offset = 0x100, 151 151 .map_io = davinci_sffsdr_map_io, 152 152 .init_irq = davinci_irq_init, 153 - .init_time = davinci_timer_init, 153 + .init_time = dm644x_init_time, 154 154 .init_machine = davinci_sffsdr_init, 155 155 .init_late = davinci_init_late, 156 156 .dma_zone_size = SZ_128M, 157 - .restart = davinci_restart, 158 157 MACHINE_END
-3
arch/arm/mach-davinci/clock.h
··· 135 135 void davinci_clk_enable(struct clk *clk); 136 136 void davinci_clk_disable(struct clk *clk); 137 137 138 - extern struct platform_device davinci_wdt_device; 139 - extern void davinci_watchdog_reset(struct platform_device *); 140 - 141 138 #endif 142 139 143 140 #endif
+5 -2
arch/arm/mach-davinci/da830.c
··· 1200 1200 .jtag_id_reg = DA8XX_SYSCFG0_BASE + DA8XX_JTAG_ID_REG, 1201 1201 .ids = da830_ids, 1202 1202 .ids_num = ARRAY_SIZE(da830_ids), 1203 - .cpu_clks = da830_clks, 1204 1203 .psc_bases = da830_psc_bases, 1205 1204 .psc_bases_num = ARRAY_SIZE(da830_psc_bases), 1206 1205 .pinmux_base = DA8XX_SYSCFG0_BASE + 0x120, ··· 1219 1220 1220 1221 da8xx_syscfg0_base = ioremap(DA8XX_SYSCFG0_BASE, SZ_4K); 1221 1222 WARN(!da8xx_syscfg0_base, "Unable to map syscfg0 module"); 1223 + } 1222 1224 1223 - davinci_clk_init(davinci_soc_info_da830.cpu_clks); 1225 + void __init da830_init_time(void) 1226 + { 1227 + davinci_clk_init(da830_clks); 1228 + davinci_timer_init(); 1224 1229 }
+5 -2
arch/arm/mach-davinci/da850.c
··· 1353 1353 .jtag_id_reg = DA8XX_SYSCFG0_BASE + DA8XX_JTAG_ID_REG, 1354 1354 .ids = da850_ids, 1355 1355 .ids_num = ARRAY_SIZE(da850_ids), 1356 - .cpu_clks = da850_clks, 1357 1356 .psc_bases = da850_psc_bases, 1358 1357 .psc_bases_num = ARRAY_SIZE(da850_psc_bases), 1359 1358 .pinmux_base = DA8XX_SYSCFG0_BASE + 0x120, ··· 1391 1392 v = __raw_readl(DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG)); 1392 1393 v &= ~CFGCHIP3_PLL1_MASTER_LOCK; 1393 1394 __raw_writel(v, DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP3_REG)); 1395 + } 1394 1396 1395 - davinci_clk_init(davinci_soc_info_da850.cpu_clks); 1397 + void __init da850_init_time(void) 1398 + { 1399 + davinci_clk_init(da850_clks); 1400 + davinci_timer_init(); 1396 1401 }
+1 -2
arch/arm/mach-davinci/da8xx-dt.c
··· 96 96 97 97 DT_MACHINE_START(DA850_DT, "Generic DA850/OMAP-L138/AM18x") 98 98 .map_io = da850_init, 99 - .init_time = davinci_timer_init, 99 + .init_time = da850_init_time, 100 100 .init_machine = da850_init_machine, 101 101 .dt_compat = da850_boards_compat, 102 102 .init_late = davinci_init_late, 103 - .restart = da8xx_restart, 104 103 MACHINE_END 105 104 106 105 #endif
+4
arch/arm/mach-davinci/davinci.h
··· 83 83 84 84 /* DM355 function declarations */ 85 85 void dm355_init(void); 86 + void dm355_init_time(void); 86 87 void dm355_init_spi0(unsigned chipselect_mask, 87 88 const struct spi_board_info *info, unsigned len); 88 89 void dm355_init_asp1(u32 evt_enable); ··· 92 91 93 92 /* DM365 function declarations */ 94 93 void dm365_init(void); 94 + void dm365_init_time(void); 95 95 void dm365_init_asp(void); 96 96 void dm365_init_vc(void); 97 97 void dm365_init_ks(struct davinci_ks_platform_data *pdata); ··· 104 102 105 103 /* DM644x function declarations */ 106 104 void dm644x_init(void); 105 + void dm644x_init_time(void); 107 106 void dm644x_init_asp(void); 108 107 int dm644x_init_video(struct vpfe_config *, struct vpbe_config *); 109 108 int dm644x_gpio_register(void); 110 109 111 110 /* DM646x function declarations */ 112 111 void dm646x_init(void); 112 + void dm646x_init_time(unsigned long ref_clk_rate, unsigned long aux_clkin_rate); 113 113 void dm646x_init_mcasp0(struct snd_platform_data *pdata); 114 114 void dm646x_init_mcasp1(struct snd_platform_data *pdata); 115 115 int dm646x_init_edma(struct edma_rsv_info *rsv);
+23 -36
arch/arm/mach-davinci/devices-da8xx.c
··· 11 11 * (at your option) any later version. 12 12 */ 13 13 #include <linux/init.h> 14 - #include <linux/platform_data/syscon.h> 15 14 #include <linux/platform_device.h> 16 15 #include <linux/dma-contiguous.h> 17 16 #include <linux/serial_8250.h> ··· 369 370 .num_resources = ARRAY_SIZE(da8xx_watchdog_resources), 370 371 .resource = da8xx_watchdog_resources, 371 372 }; 372 - 373 - void da8xx_restart(enum reboot_mode mode, const char *cmd) 374 - { 375 - struct device *dev; 376 - 377 - dev = bus_find_device_by_name(&platform_bus_type, NULL, "davinci-wdt"); 378 - if (!dev) { 379 - pr_err("%s: failed to find watchdog device\n", __func__); 380 - return; 381 - } 382 - 383 - davinci_watchdog_reset(to_platform_device(dev)); 384 - } 385 373 386 374 int __init da8xx_register_watchdog(void) 387 375 { ··· 1104 1118 } 1105 1119 #endif 1106 1120 1107 - static struct syscon_platform_data da8xx_cfgchip_platform_data = { 1108 - .label = "cfgchip", 1121 + static struct regmap *da8xx_cfgchip; 1122 + 1123 + static const struct regmap_config da8xx_cfgchip_config __initconst = { 1124 + .name = "cfgchip", 1125 + .reg_bits = 32, 1126 + .val_bits = 32, 1127 + .reg_stride = 4, 1128 + .max_register = DA8XX_CFGCHIP4_REG - DA8XX_CFGCHIP0_REG, 1109 1129 }; 1110 1130 1111 - static struct resource da8xx_cfgchip_resources[] = { 1112 - { 1113 - .start = DA8XX_SYSCFG0_BASE + DA8XX_CFGCHIP0_REG, 1114 - .end = DA8XX_SYSCFG0_BASE + DA8XX_CFGCHIP4_REG + 3, 1115 - .flags = IORESOURCE_MEM, 1116 - }, 1117 - }; 1118 - 1119 - static struct platform_device da8xx_cfgchip_device = { 1120 - .name = "syscon", 1121 - .id = -1, 1122 - .dev = { 1123 - .platform_data = &da8xx_cfgchip_platform_data, 1124 - }, 1125 - .num_resources = ARRAY_SIZE(da8xx_cfgchip_resources), 1126 - .resource = da8xx_cfgchip_resources, 1127 - }; 1128 - 1129 - int __init da8xx_register_cfgchip(void) 1131 + /** 1132 + * da8xx_get_cfgchip - Lazy gets CFGCHIP as regmap 1133 + * 1134 + * This is for use on non-DT boards only. For DT boards, use 1135 + * syscon_regmap_lookup_by_compatible("ti,da830-cfgchip") 1136 + * 1137 + * Returns: Pointer to the CFGCHIP regmap or negative error code. 1138 + */ 1139 + struct regmap * __init da8xx_get_cfgchip(void) 1130 1140 { 1131 - return platform_device_register(&da8xx_cfgchip_device); 1141 + if (IS_ERR_OR_NULL(da8xx_cfgchip)) 1142 + da8xx_cfgchip = regmap_init_mmio(NULL, 1143 + DA8XX_SYSCFG0_VIRT(DA8XX_CFGCHIP0_REG), 1144 + &da8xx_cfgchip_config); 1145 + 1146 + return da8xx_cfgchip; 1132 1147 }
+1 -6
arch/arm/mach-davinci/devices.c
··· 282 282 }, 283 283 }; 284 284 285 - struct platform_device davinci_wdt_device = { 285 + static struct platform_device davinci_wdt_device = { 286 286 .name = "davinci-wdt", 287 287 .id = -1, 288 288 .num_resources = ARRAY_SIZE(wdt_resources), 289 289 .resource = wdt_resources, 290 290 }; 291 - 292 - void davinci_restart(enum reboot_mode mode, const char *cmd) 293 - { 294 - davinci_watchdog_reset(&davinci_wdt_device); 295 - } 296 291 297 292 int davinci_init_wdt(void) 298 293 {
+6 -2
arch/arm/mach-davinci/dm355.c
··· 1012 1012 .jtag_id_reg = 0x01c40028, 1013 1013 .ids = dm355_ids, 1014 1014 .ids_num = ARRAY_SIZE(dm355_ids), 1015 - .cpu_clks = dm355_clks, 1016 1015 .psc_bases = dm355_psc_bases, 1017 1016 .psc_bases_num = ARRAY_SIZE(dm355_psc_bases), 1018 1017 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, ··· 1042 1043 { 1043 1044 davinci_common_init(&davinci_soc_info_dm355); 1044 1045 davinci_map_sysmod(); 1045 - davinci_clk_init(davinci_soc_info_dm355.cpu_clks); 1046 + } 1047 + 1048 + void __init dm355_init_time(void) 1049 + { 1050 + davinci_clk_init(dm355_clks); 1051 + davinci_timer_init(); 1046 1052 } 1047 1053 1048 1054 int __init dm355_init_video(struct vpfe_config *vpfe_cfg,
+6 -2
arch/arm/mach-davinci/dm365.c
··· 1116 1116 .jtag_id_reg = 0x01c40028, 1117 1117 .ids = dm365_ids, 1118 1118 .ids_num = ARRAY_SIZE(dm365_ids), 1119 - .cpu_clks = dm365_clks, 1120 1119 .psc_bases = dm365_psc_bases, 1121 1120 .psc_bases_num = ARRAY_SIZE(dm365_psc_bases), 1122 1121 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, ··· 1167 1168 { 1168 1169 davinci_common_init(&davinci_soc_info_dm365); 1169 1170 davinci_map_sysmod(); 1170 - davinci_clk_init(davinci_soc_info_dm365.cpu_clks); 1171 + } 1172 + 1173 + void __init dm365_init_time(void) 1174 + { 1175 + davinci_clk_init(dm365_clks); 1176 + davinci_timer_init(); 1171 1177 } 1172 1178 1173 1179 static struct resource dm365_vpss_resources[] = {
+6 -2
arch/arm/mach-davinci/dm644x.c
··· 905 905 .jtag_id_reg = 0x01c40028, 906 906 .ids = dm644x_ids, 907 907 .ids_num = ARRAY_SIZE(dm644x_ids), 908 - .cpu_clks = dm644x_clks, 909 908 .psc_bases = dm644x_psc_bases, 910 909 .psc_bases_num = ARRAY_SIZE(dm644x_psc_bases), 911 910 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, ··· 930 931 { 931 932 davinci_common_init(&davinci_soc_info_dm644x); 932 933 davinci_map_sysmod(); 933 - davinci_clk_init(davinci_soc_info_dm644x.cpu_clks); 934 + } 935 + 936 + void __init dm644x_init_time(void) 937 + { 938 + davinci_clk_init(dm644x_clks); 939 + davinci_timer_init(); 934 940 } 935 941 936 942 int __init dm644x_init_video(struct vpfe_config *vpfe_cfg,
+11 -11
arch/arm/mach-davinci/dm646x.c
··· 39 39 #define VSCLKDIS_MASK (BIT_MASK(11) | BIT_MASK(10) | BIT_MASK(9) |\ 40 40 BIT_MASK(8)) 41 41 42 - /* 43 - * Device specific clocks 44 - */ 45 - #define DM646X_REF_FREQ 27000000 46 - #define DM646X_AUX_FREQ 24000000 47 - 48 42 #define DM646X_EMAC_BASE 0x01c80000 49 43 #define DM646X_EMAC_MDIO_BASE (DM646X_EMAC_BASE + 0x4000) 50 44 #define DM646X_EMAC_CNTRL_OFFSET 0x0000 ··· 58 64 59 65 static struct clk ref_clk = { 60 66 .name = "ref_clk", 61 - .rate = DM646X_REF_FREQ, 62 - .set_rate = davinci_simple_set_rate, 67 + /* rate is initialized in dm646x_init_time() */ 63 68 }; 64 69 65 70 static struct clk aux_clkin = { 66 71 .name = "aux_clkin", 67 - .rate = DM646X_AUX_FREQ, 72 + /* rate is initialized in dm646x_init_time() */ 68 73 }; 69 74 70 75 static struct clk pll1_clk = { ··· 881 888 .jtag_id_reg = 0x01c40028, 882 889 .ids = dm646x_ids, 883 890 .ids_num = ARRAY_SIZE(dm646x_ids), 884 - .cpu_clks = dm646x_clks, 885 891 .psc_bases = dm646x_psc_bases, 886 892 .psc_bases_num = ARRAY_SIZE(dm646x_psc_bases), 887 893 .pinmux_base = DAVINCI_SYSTEM_MODULE_BASE, ··· 948 956 { 949 957 davinci_common_init(&davinci_soc_info_dm646x); 950 958 davinci_map_sysmod(); 951 - davinci_clk_init(davinci_soc_info_dm646x.cpu_clks); 959 + } 960 + 961 + void __init dm646x_init_time(unsigned long ref_clk_rate, 962 + unsigned long aux_clkin_rate) 963 + { 964 + ref_clk.rate = ref_clk_rate; 965 + aux_clkin.rate = aux_clkin_rate; 966 + davinci_clk_init(dm646x_clks); 967 + davinci_timer_init(); 952 968 } 953 969 954 970 static int __init dm646x_init_devices(void)
-2
arch/arm/mach-davinci/include/mach/common.h
··· 53 53 u32 jtag_id_reg; 54 54 struct davinci_id *ids; 55 55 unsigned long ids_num; 56 - struct clk_lookup *cpu_clks; 57 56 u32 *psc_bases; 58 57 unsigned long psc_bases_num; 59 58 u32 pinmux_base; ··· 80 81 81 82 extern void davinci_common_init(const struct davinci_soc_info *soc_info); 82 83 extern void davinci_init_ide(void); 83 - void davinci_restart(enum reboot_mode mode, const char *cmd); 84 84 void davinci_init_late(void); 85 85 86 86 #ifdef CONFIG_DAVINCI_RESET_CLOCKS
+5 -2
arch/arm/mach-davinci/include/mach/da8xx.h
··· 18 18 #include <linux/spi/spi.h> 19 19 #include <linux/platform_data/davinci_asp.h> 20 20 #include <linux/reboot.h> 21 + #include <linux/regmap.h> 21 22 #include <linux/videodev2.h> 22 23 23 24 #include <mach/serial.h> ··· 88 87 #define DA8XX_ARM_RAM_BASE 0xffff0000 89 88 90 89 void da830_init(void); 90 + void da830_init_time(void); 91 + 91 92 void da850_init(void); 93 + void da850_init_time(void); 92 94 93 95 int da830_register_edma(struct edma_rsv_info *rsv); 94 96 int da850_register_edma(struct edma_rsv_info *rsv[2]); ··· 122 118 (struct vpif_display_config *display_config); 123 119 int da850_register_vpif_capture 124 120 (struct vpif_capture_config *capture_config); 125 - void da8xx_restart(enum reboot_mode mode, const char *cmd); 126 121 void da8xx_rproc_reserve_cma(void); 127 122 int da8xx_register_rproc(void); 128 123 int da850_register_gpio(void); 129 124 int da830_register_gpio(void); 130 - int da8xx_register_cfgchip(void); 125 + struct regmap *da8xx_get_cfgchip(void); 131 126 132 127 extern struct platform_device da8xx_serial_device[]; 133 128 extern struct emac_platform_data da8xx_emac_pdata;
-57
arch/arm/mach-davinci/time.c
··· 80 80 #define TGCR_UNRESET 0x1 81 81 #define TGCR_RESET_MASK 0x3 82 82 83 - #define WDTCR_WDEN_SHIFT 14 84 - #define WDTCR_WDEN_DISABLE 0x0 85 - #define WDTCR_WDEN_ENABLE 0x1 86 - #define WDTCR_WDKEY_SHIFT 16 87 - #define WDTCR_WDKEY_SEQ0 0xa5c6 88 - #define WDTCR_WDKEY_SEQ1 0xda7e 89 - 90 83 struct timer_s { 91 84 char *name; 92 85 unsigned int id; ··· 401 408 402 409 for (i=0; i< ARRAY_SIZE(timers); i++) 403 410 timer32_config(&timers[i]); 404 - } 405 - 406 - /* reset board using watchdog timer */ 407 - void davinci_watchdog_reset(struct platform_device *pdev) 408 - { 409 - u32 tgcr, wdtcr; 410 - void __iomem *base; 411 - struct clk *wd_clk; 412 - 413 - base = ioremap(pdev->resource[0].start, SZ_4K); 414 - if (WARN_ON(!base)) 415 - return; 416 - 417 - wd_clk = clk_get(&pdev->dev, NULL); 418 - if (WARN_ON(IS_ERR(wd_clk))) 419 - return; 420 - clk_prepare_enable(wd_clk); 421 - 422 - /* disable, internal clock source */ 423 - __raw_writel(0, base + TCR); 424 - 425 - /* reset timer, set mode to 64-bit watchdog, and unreset */ 426 - tgcr = 0; 427 - __raw_writel(tgcr, base + TGCR); 428 - tgcr = TGCR_TIMMODE_64BIT_WDOG << TGCR_TIMMODE_SHIFT; 429 - tgcr |= (TGCR_UNRESET << TGCR_TIM12RS_SHIFT) | 430 - (TGCR_UNRESET << TGCR_TIM34RS_SHIFT); 431 - __raw_writel(tgcr, base + TGCR); 432 - 433 - /* clear counter and period regs */ 434 - __raw_writel(0, base + TIM12); 435 - __raw_writel(0, base + TIM34); 436 - __raw_writel(0, base + PRD12); 437 - __raw_writel(0, base + PRD34); 438 - 439 - /* put watchdog in pre-active state */ 440 - wdtcr = __raw_readl(base + WDTCR); 441 - wdtcr = (WDTCR_WDKEY_SEQ0 << WDTCR_WDKEY_SHIFT) | 442 - (WDTCR_WDEN_ENABLE << WDTCR_WDEN_SHIFT); 443 - __raw_writel(wdtcr, base + WDTCR); 444 - 445 - /* put watchdog in active state */ 446 - wdtcr = (WDTCR_WDKEY_SEQ1 << WDTCR_WDKEY_SHIFT) | 447 - (WDTCR_WDEN_ENABLE << WDTCR_WDEN_SHIFT); 448 - __raw_writel(wdtcr, base + WDTCR); 449 - 450 - /* write an invalid value to the WDKEY field to trigger 451 - * a watchdog reset */ 452 - wdtcr = 0x00004000; 453 - __raw_writel(wdtcr, base + WDTCR); 454 411 }
+12 -6
arch/arm/mach-davinci/usb-da8xx.c
··· 8 8 #include <linux/init.h> 9 9 #include <linux/mfd/da8xx-cfgchip.h> 10 10 #include <linux/phy/phy.h> 11 + #include <linux/platform_data/phy-da8xx-usb.h> 11 12 #include <linux/platform_data/usb-davinci.h> 12 13 #include <linux/platform_device.h> 13 14 #include <linux/usb/musb.h> ··· 26 25 27 26 static struct clk *usb20_clk; 28 27 28 + static struct da8xx_usb_phy_platform_data da8xx_usb_phy_pdata; 29 + 29 30 static struct platform_device da8xx_usb_phy = { 30 31 .name = "da8xx-usb-phy", 31 32 .id = -1, ··· 38 35 * registered yet. 39 36 */ 40 37 .init_name = "da8xx-usb-phy", 38 + .platform_data = &da8xx_usb_phy_pdata, 41 39 }, 42 40 }; 43 41 44 42 int __init da8xx_register_usb_phy(void) 45 43 { 44 + da8xx_usb_phy_pdata.cfgchip = da8xx_get_cfgchip(); 45 + 46 46 return platform_device_register(&da8xx_usb_phy); 47 47 } 48 48 ··· 262 256 } 263 257 264 258 static struct clk usb20_phy_clk = { 265 - .name = "usb20_phy", 259 + .name = "usb0_clk48", 266 260 .clk_enable = usb20_phy_clk_enable, 267 261 .clk_disable = usb20_phy_clk_disable, 268 262 .set_parent = usb20_phy_clk_set_parent, 269 263 }; 270 264 271 265 static struct clk_lookup usb20_phy_clk_lookup = 272 - CLK("da8xx-usb-phy", "usb20_phy", &usb20_phy_clk); 266 + CLK("da8xx-usb-phy", "usb0_clk48", &usb20_phy_clk); 273 267 274 268 /** 275 269 * da8xx_register_usb20_phy_clk - register USB0PHYCLKMUX clock ··· 326 320 } 327 321 328 322 static struct clk usb11_phy_clk = { 329 - .name = "usb11_phy", 323 + .name = "usb1_clk48", 330 324 .set_parent = usb11_phy_clk_set_parent, 331 325 }; 332 326 333 327 static struct clk_lookup usb11_phy_clk_lookup = 334 - CLK("da8xx-usb-phy", "usb11_phy", &usb11_phy_clk); 328 + CLK("da8xx-usb-phy", "usb1_clk48", &usb11_phy_clk); 335 329 336 330 /** 337 331 * da8xx_register_usb11_phy_clk - register USB1PHYCLKMUX clock 338 332 * 339 333 * @use_usb_refclkin: Selects the parent clock - either "usb_refclkin" if true 340 - * or "usb20_phy" if false. 334 + * or "usb0_clk48" if false. 341 335 */ 342 336 int __init da8xx_register_usb11_phy_clk(bool use_usb_refclkin) 343 337 { ··· 347 341 if (use_usb_refclkin) 348 342 parent = clk_get(NULL, "usb_refclkin"); 349 343 else 350 - parent = clk_get(&da8xx_usb_phy.dev, "usb20_phy"); 344 + parent = clk_get(&da8xx_usb_phy.dev, "usb0_clk48"); 351 345 if (IS_ERR(parent)) 352 346 return PTR_ERR(parent); 353 347
+2 -1
arch/arm/mach-exynos/exynos.c
··· 192 192 #endif 193 193 if (of_machine_is_compatible("samsung,exynos4210") || 194 194 (of_machine_is_compatible("samsung,exynos4412") && 195 - of_machine_is_compatible("samsung,trats2")) || 195 + (of_machine_is_compatible("samsung,trats2") || 196 + of_machine_is_compatible("samsung,midas"))) || 196 197 of_machine_is_compatible("samsung,exynos3250") || 197 198 of_machine_is_compatible("samsung,exynos5250")) 198 199 platform_device_register(&exynos_cpuidle);
+2 -6
arch/arm/mach-exynos/pm.c
··· 163 163 164 164 exynos_pm_central_suspend(); 165 165 166 - if (of_machine_is_compatible("samsung,exynos4412")) { 166 + if (soc_is_exynos4412()) { 167 167 /* Setting SEQ_OPTION register */ 168 168 pmu_raw_writel(S5P_USE_STANDBY_WFI0 | S5P_USE_STANDBY_WFE0, 169 169 S5P_CENTRAL_SEQ_OPTION); ··· 271 271 goto fail; 272 272 273 273 call_firmware_op(cpu_boot, 1); 274 - 275 - if (soc_is_exynos3250()) 276 - dsb_sev(); 277 - else 278 - arch_send_wakeup_ipi_mask(cpumask_of(1)); 274 + dsb_sev(); 279 275 } 280 276 } 281 277 fail:
+8 -14
arch/arm/mach-imx/Kconfig
··· 32 32 data/address de-multiplexing and decode, signal level shift, 33 33 interrupt control and various board functions. 34 34 35 - config HAVE_EPIT 36 - bool 37 - 38 - config MXC_USE_EPIT 39 - bool "Use EPIT instead of GPT" 40 - depends on HAVE_EPIT 41 - help 42 - Use EPIT as the system timer on systems that have it. Normally you 43 - don't have a reason to do so as the EPIT has the same features and 44 - uses the same clocks as the GPT. Anyway, on some systems the GPT 45 - may be in use for other purposes. 46 - 47 35 config HAVE_IMX_ANATOP 48 36 bool 49 37 ··· 73 85 config SOC_IMX35 74 86 bool 75 87 select ARCH_MXC_IOMUX_V3 76 - select HAVE_EPIT 77 88 select MXC_AVIC 78 89 select PINCTRL_IMX35 79 90 ··· 469 482 470 483 config SOC_IMX6 471 484 bool 472 - select ARM_CPU_SUSPEND if PM 485 + select ARM_CPU_SUSPEND if (PM || CPU_IDLE) 473 486 select ARM_ERRATA_754322 474 487 select ARM_ERRATA_775420 475 488 select ARM_GIC ··· 498 511 499 512 help 500 513 This enables support for Freescale i.MX6 SoloLite processor. 514 + 515 + config SOC_IMX6SLL 516 + bool "i.MX6 SoloLiteLite support" 517 + select SOC_IMX6 518 + 519 + help 520 + This enables support for Freescale i.MX6 SoloLiteLite processor. 501 521 502 522 config SOC_IMX6SX 503 523 bool "i.MX6 SoloX support"
+2 -1
arch/arm/mach-imx/Makefile
··· 20 20 obj-$(CONFIG_MXC_TZIC) += tzic.o 21 21 obj-$(CONFIG_MXC_AVIC) += avic.o 22 22 23 - obj-$(CONFIG_MXC_USE_EPIT) += epit.o 24 23 obj-$(CONFIG_MXC_DEBUG_BOARD) += 3ds_debugboard.o 25 24 26 25 ifeq ($(CONFIG_CPU_IDLE),y) 27 26 obj-$(CONFIG_SOC_IMX5) += cpuidle-imx5.o 28 27 obj-$(CONFIG_SOC_IMX6Q) += cpuidle-imx6q.o 29 28 obj-$(CONFIG_SOC_IMX6SL) += cpuidle-imx6sl.o 29 + obj-$(CONFIG_SOC_IMX6SLL) += cpuidle-imx6sl.o 30 30 obj-$(CONFIG_SOC_IMX6SX) += cpuidle-imx6sx.o 31 31 obj-$(CONFIG_SOC_IMX6UL) += cpuidle-imx6sx.o 32 32 endif ··· 78 78 endif 79 79 obj-$(CONFIG_SOC_IMX6Q) += mach-imx6q.o 80 80 obj-$(CONFIG_SOC_IMX6SL) += mach-imx6sl.o 81 + obj-$(CONFIG_SOC_IMX6SLL) += mach-imx6sl.o 81 82 obj-$(CONFIG_SOC_IMX6SX) += mach-imx6sx.o 82 83 obj-$(CONFIG_SOC_IMX6UL) += mach-imx6ul.o 83 84 obj-$(CONFIG_SOC_IMX7D) += mach-imx7d.o
+20 -38
arch/arm/mach-imx/anatop.c
··· 1 1 /* 2 2 * Copyright (C) 2013-2015 Freescale Semiconductor, Inc. 3 + * Copyright 2017-2018 NXP. 3 4 * 4 5 * The code contained herein is licensed under the GNU General Public 5 6 * License. You may obtain a copy of the GNU General Public License ··· 117 116 unsigned int revision; 118 117 u32 digprog; 119 118 u16 offset = ANADIG_DIGPROG; 119 + u8 major_part, minor_part; 120 120 121 121 np = of_find_compatible_node(NULL, NULL, "fsl,imx6q-anatop"); 122 122 anatop_base = of_iomap(np, 0); ··· 129 127 digprog = readl_relaxed(anatop_base + offset); 130 128 iounmap(anatop_base); 131 129 132 - switch (digprog & 0xff) { 133 - case 0: 134 - /* 135 - * For i.MX6QP, most of the code for i.MX6Q can be resued, 136 - * so internally, we identify it as i.MX6Q Rev 2.0 137 - */ 138 - if (digprog >> 8 & 0x01) 139 - revision = IMX_CHIP_REVISION_2_0; 140 - else 141 - revision = IMX_CHIP_REVISION_1_0; 142 - break; 143 - case 1: 144 - revision = IMX_CHIP_REVISION_1_1; 145 - break; 146 - case 2: 147 - revision = IMX_CHIP_REVISION_1_2; 148 - break; 149 - case 3: 150 - revision = IMX_CHIP_REVISION_1_3; 151 - break; 152 - case 4: 153 - revision = IMX_CHIP_REVISION_1_4; 154 - break; 155 - case 5: 156 - /* 157 - * i.MX6DQ TO1.5 is defined as Rev 1.3 in Data Sheet, marked 158 - * as 'D' in Part Number last character. 159 - */ 160 - revision = IMX_CHIP_REVISION_1_5; 161 - break; 162 - default: 163 - /* 164 - * Fail back to return raw register value instead of 0xff. 165 - * It will be easy to know version information in SOC if it 166 - * can't be recognized by known version. And some chip's (i.MX7D) 167 - * digprog value match linux version format, so it needn't map 168 - * again and we can use register value directly. 169 - */ 130 + /* 131 + * On i.MX7D digprog value match linux version format, so 132 + * it needn't map again and we can use register value directly. 133 + */ 134 + if (of_device_is_compatible(np, "fsl,imx7d-anatop")) { 170 135 revision = digprog & 0xff; 136 + } else { 137 + /* 138 + * MAJOR: [15:8], the major silicon revison; 139 + * MINOR: [7: 0], the minor silicon revison; 140 + * 141 + * please refer to the i.MX RM for the detailed 142 + * silicon revison bit define. 143 + * format the major part and minor part to match the 144 + * linux kernel soc version format. 145 + */ 146 + major_part = (digprog >> 8) & 0xf; 147 + minor_part = digprog & 0xf; 148 + revision = ((major_part + 1) << 4) | minor_part; 171 149 } 172 150 173 151 mxc_set_cpu_type(digprog >> 16 & 0xff);
+37
arch/arm/mach-imx/avic.c
··· 22 22 #include <linux/irqdomain.h> 23 23 #include <linux/io.h> 24 24 #include <linux/of.h> 25 + #include <linux/of_address.h> 25 26 #include <asm/mach/irq.h> 26 27 #include <asm/exception.h> 27 28 ··· 52 51 53 52 #define AVIC_NUM_IRQS 64 54 53 54 + /* low power interrupt mask registers */ 55 + #define MX25_CCM_LPIMR0 0x68 56 + #define MX25_CCM_LPIMR1 0x6C 57 + 55 58 static void __iomem *avic_base; 59 + static void __iomem *mx25_ccm_base; 56 60 static struct irq_domain *domain; 57 61 58 62 #ifdef CONFIG_FIQ ··· 99 93 100 94 avic_saved_mask_reg[idx] = imx_readl(avic_base + ct->regs.mask); 101 95 imx_writel(gc->wake_active, avic_base + ct->regs.mask); 96 + 97 + if (mx25_ccm_base) { 98 + u8 offs = d->hwirq < AVIC_NUM_IRQS / 2 ? 99 + MX25_CCM_LPIMR0 : MX25_CCM_LPIMR1; 100 + /* 101 + * The interrupts which are still enabled will be used as wakeup 102 + * sources. Allow those interrupts in low-power mode. 103 + * The LPIMR registers use 0 to allow an interrupt, the AVIC 104 + * registers use 1. 105 + */ 106 + imx_writel(~gc->wake_active, mx25_ccm_base + offs); 107 + } 102 108 } 103 109 104 110 static void avic_irq_resume(struct irq_data *d) ··· 120 102 int idx = d->hwirq >> 5; 121 103 122 104 imx_writel(avic_saved_mask_reg[idx], avic_base + ct->regs.mask); 105 + 106 + if (mx25_ccm_base) { 107 + u8 offs = d->hwirq < AVIC_NUM_IRQS / 2 ? 108 + MX25_CCM_LPIMR0 : MX25_CCM_LPIMR1; 109 + 110 + imx_writel(0xffffffff, mx25_ccm_base + offs); 111 + } 123 112 } 124 113 125 114 #else ··· 182 157 int i; 183 158 184 159 avic_base = irqbase; 160 + 161 + np = of_find_compatible_node(NULL, NULL, "fsl,imx25-ccm"); 162 + mx25_ccm_base = of_iomap(np, 0); 163 + 164 + if (mx25_ccm_base) { 165 + /* 166 + * By default, we mask all interrupts. We set the actual mask 167 + * before we go into low-power mode. 168 + */ 169 + imx_writel(0xffffffff, mx25_ccm_base + MX25_CCM_LPIMR0); 170 + imx_writel(0xffffffff, mx25_ccm_base + MX25_CCM_LPIMR1); 171 + } 185 172 186 173 /* put the AVIC into the reset value with 187 174 * all interrupts disabled
+3
arch/arm/mach-imx/cpu.c
··· 135 135 case MXC_CPU_IMX6ULL: 136 136 soc_id = "i.MX6ULL"; 137 137 break; 138 + case MXC_CPU_IMX6SLL: 139 + soc_id = "i.MX6SLL"; 140 + break; 138 141 case MXC_CPU_IMX7D: 139 142 soc_id = "i.MX7D"; 140 143 break;
+5 -2
arch/arm/mach-imx/cpuidle-imx6sl.c
··· 12 12 13 13 #include "common.h" 14 14 #include "cpuidle.h" 15 + #include "hardware.h" 15 16 16 17 static int imx6sl_enter_wait(struct cpuidle_device *dev, 17 18 struct cpuidle_driver *drv, int index) ··· 22 21 * Software workaround for ERR005311, see function 23 22 * description for details. 24 23 */ 25 - imx6sl_set_wait_clk(true); 24 + if (cpu_is_imx6sl()) 25 + imx6sl_set_wait_clk(true); 26 26 cpu_do_idle(); 27 - imx6sl_set_wait_clk(false); 27 + if (cpu_is_imx6sl()) 28 + imx6sl_set_wait_clk(false); 28 29 imx6_set_lpm(WAIT_CLOCKED); 29 30 30 31 return index;
+1
arch/arm/mach-imx/cpuidle-imx6sx.c
··· 89 89 */ 90 90 .exit_latency = 300, 91 91 .target_residency = 500, 92 + .flags = CPUIDLE_FLAG_TIMER_STOP, 92 93 .enter = imx6sx_enter_wait, 93 94 .name = "LOW-POWER-IDLE", 94 95 .desc = "ARM power off",
-228
arch/arm/mach-imx/epit.c
··· 1 - /* 2 - * linux/arch/arm/plat-mxc/epit.c 3 - * 4 - * Copyright (C) 2010 Sascha Hauer <s.hauer@pengutronix.de> 5 - * 6 - * This program is free software; you can redistribute it and/or 7 - * modify it under the terms of the GNU General Public License 8 - * as published by the Free Software Foundation; either version 2 9 - * of the License, or (at your option) any later version. 10 - * This program is distributed in the hope that it will be useful, 11 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 - * GNU General Public License for more details. 14 - * 15 - * You should have received a copy of the GNU General Public License 16 - * along with this program; if not, write to the Free Software 17 - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 18 - * MA 02110-1301, USA. 19 - */ 20 - 21 - #define EPITCR 0x00 22 - #define EPITSR 0x04 23 - #define EPITLR 0x08 24 - #define EPITCMPR 0x0c 25 - #define EPITCNR 0x10 26 - 27 - #define EPITCR_EN (1 << 0) 28 - #define EPITCR_ENMOD (1 << 1) 29 - #define EPITCR_OCIEN (1 << 2) 30 - #define EPITCR_RLD (1 << 3) 31 - #define EPITCR_PRESC(x) (((x) & 0xfff) << 4) 32 - #define EPITCR_SWR (1 << 16) 33 - #define EPITCR_IOVW (1 << 17) 34 - #define EPITCR_DBGEN (1 << 18) 35 - #define EPITCR_WAITEN (1 << 19) 36 - #define EPITCR_RES (1 << 20) 37 - #define EPITCR_STOPEN (1 << 21) 38 - #define EPITCR_OM_DISCON (0 << 22) 39 - #define EPITCR_OM_TOGGLE (1 << 22) 40 - #define EPITCR_OM_CLEAR (2 << 22) 41 - #define EPITCR_OM_SET (3 << 22) 42 - #define EPITCR_CLKSRC_OFF (0 << 24) 43 - #define EPITCR_CLKSRC_PERIPHERAL (1 << 24) 44 - #define EPITCR_CLKSRC_REF_HIGH (1 << 24) 45 - #define EPITCR_CLKSRC_REF_LOW (3 << 24) 46 - 47 - #define EPITSR_OCIF (1 << 0) 48 - 49 - #include <linux/interrupt.h> 50 - #include <linux/irq.h> 51 - #include <linux/clockchips.h> 52 - #include <linux/clk.h> 53 - #include <linux/err.h> 54 - #include <asm/mach/time.h> 55 - 56 - #include "common.h" 57 - #include "hardware.h" 58 - 59 - static struct clock_event_device clockevent_epit; 60 - 61 - static void __iomem *timer_base; 62 - 63 - static inline void epit_irq_disable(void) 64 - { 65 - u32 val; 66 - 67 - val = imx_readl(timer_base + EPITCR); 68 - val &= ~EPITCR_OCIEN; 69 - imx_writel(val, timer_base + EPITCR); 70 - } 71 - 72 - static inline void epit_irq_enable(void) 73 - { 74 - u32 val; 75 - 76 - val = imx_readl(timer_base + EPITCR); 77 - val |= EPITCR_OCIEN; 78 - imx_writel(val, timer_base + EPITCR); 79 - } 80 - 81 - static void epit_irq_acknowledge(void) 82 - { 83 - imx_writel(EPITSR_OCIF, timer_base + EPITSR); 84 - } 85 - 86 - static int __init epit_clocksource_init(struct clk *timer_clk) 87 - { 88 - unsigned int c = clk_get_rate(timer_clk); 89 - 90 - return clocksource_mmio_init(timer_base + EPITCNR, "epit", c, 200, 32, 91 - clocksource_mmio_readl_down); 92 - } 93 - 94 - /* clock event */ 95 - 96 - static int epit_set_next_event(unsigned long evt, 97 - struct clock_event_device *unused) 98 - { 99 - unsigned long tcmp; 100 - 101 - tcmp = imx_readl(timer_base + EPITCNR); 102 - 103 - imx_writel(tcmp - evt, timer_base + EPITCMPR); 104 - 105 - return 0; 106 - } 107 - 108 - /* Left event sources disabled, no more interrupts appear */ 109 - static int epit_shutdown(struct clock_event_device *evt) 110 - { 111 - unsigned long flags; 112 - 113 - /* 114 - * The timer interrupt generation is disabled at least 115 - * for enough time to call epit_set_next_event() 116 - */ 117 - local_irq_save(flags); 118 - 119 - /* Disable interrupt in GPT module */ 120 - epit_irq_disable(); 121 - 122 - /* Clear pending interrupt */ 123 - epit_irq_acknowledge(); 124 - 125 - local_irq_restore(flags); 126 - 127 - return 0; 128 - } 129 - 130 - static int epit_set_oneshot(struct clock_event_device *evt) 131 - { 132 - unsigned long flags; 133 - 134 - /* 135 - * The timer interrupt generation is disabled at least 136 - * for enough time to call epit_set_next_event() 137 - */ 138 - local_irq_save(flags); 139 - 140 - /* Disable interrupt in GPT module */ 141 - epit_irq_disable(); 142 - 143 - /* Clear pending interrupt, only while switching mode */ 144 - if (!clockevent_state_oneshot(evt)) 145 - epit_irq_acknowledge(); 146 - 147 - /* 148 - * Do not put overhead of interrupt enable/disable into 149 - * epit_set_next_event(), the core has about 4 minutes 150 - * to call epit_set_next_event() or shutdown clock after 151 - * mode switching 152 - */ 153 - epit_irq_enable(); 154 - local_irq_restore(flags); 155 - 156 - return 0; 157 - } 158 - 159 - /* 160 - * IRQ handler for the timer 161 - */ 162 - static irqreturn_t epit_timer_interrupt(int irq, void *dev_id) 163 - { 164 - struct clock_event_device *evt = &clockevent_epit; 165 - 166 - epit_irq_acknowledge(); 167 - 168 - evt->event_handler(evt); 169 - 170 - return IRQ_HANDLED; 171 - } 172 - 173 - static struct irqaction epit_timer_irq = { 174 - .name = "i.MX EPIT Timer Tick", 175 - .flags = IRQF_TIMER | IRQF_IRQPOLL, 176 - .handler = epit_timer_interrupt, 177 - }; 178 - 179 - static struct clock_event_device clockevent_epit = { 180 - .name = "epit", 181 - .features = CLOCK_EVT_FEAT_ONESHOT, 182 - .set_state_shutdown = epit_shutdown, 183 - .tick_resume = epit_shutdown, 184 - .set_state_oneshot = epit_set_oneshot, 185 - .set_next_event = epit_set_next_event, 186 - .rating = 200, 187 - }; 188 - 189 - static int __init epit_clockevent_init(struct clk *timer_clk) 190 - { 191 - clockevent_epit.cpumask = cpumask_of(0); 192 - clockevents_config_and_register(&clockevent_epit, 193 - clk_get_rate(timer_clk), 194 - 0x800, 0xfffffffe); 195 - 196 - return 0; 197 - } 198 - 199 - void __init epit_timer_init(void __iomem *base, int irq) 200 - { 201 - struct clk *timer_clk; 202 - 203 - timer_clk = clk_get_sys("imx-epit.0", NULL); 204 - if (IS_ERR(timer_clk)) { 205 - pr_err("i.MX epit: unable to get clk\n"); 206 - return; 207 - } 208 - 209 - clk_prepare_enable(timer_clk); 210 - 211 - timer_base = base; 212 - 213 - /* 214 - * Initialise to a known state (all timers off, and timing reset) 215 - */ 216 - imx_writel(0x0, timer_base + EPITCR); 217 - 218 - imx_writel(0xffffffff, timer_base + EPITLR); 219 - imx_writel(EPITCR_EN | EPITCR_CLKSRC_REF_HIGH | EPITCR_WAITEN, 220 - timer_base + EPITCR); 221 - 222 - /* init and register the timer to the framework */ 223 - epit_clocksource_init(timer_clk); 224 - epit_clockevent_init(timer_clk); 225 - 226 - /* Make irqs happen */ 227 - setup_irq(irq, &epit_timer_irq); 228 - }
+8 -2
arch/arm/mach-imx/mach-imx6sl.c
··· 18 18 19 19 #include "common.h" 20 20 #include "cpuidle.h" 21 + #include "hardware.h" 21 22 22 23 static void __init imx6sl_fec_init(void) 23 24 { ··· 55 54 56 55 of_platform_default_populate(NULL, NULL, parent); 57 56 58 - imx6sl_fec_init(); 57 + if (cpu_is_imx6sl()) 58 + imx6sl_fec_init(); 59 59 imx_anatop_init(); 60 60 imx6sl_pm_init(); 61 61 } ··· 68 66 imx_init_l2cache(); 69 67 imx_src_init(); 70 68 irqchip_init(); 71 - imx6_pm_ccm_init("fsl,imx6sl-ccm"); 69 + if (cpu_is_imx6sl()) 70 + imx6_pm_ccm_init("fsl,imx6sl-ccm"); 71 + else 72 + imx6_pm_ccm_init("fsl,imx6sll-ccm"); 72 73 } 73 74 74 75 static const char * const imx6sl_dt_compat[] __initconst = { 75 76 "fsl,imx6sl", 77 + "fsl,imx6sll", 76 78 NULL, 77 79 }; 78 80
+6
arch/arm/mach-imx/mxc.h
··· 40 40 #define MXC_CPU_IMX6Q 0x63 41 41 #define MXC_CPU_IMX6UL 0x64 42 42 #define MXC_CPU_IMX6ULL 0x65 43 + #define MXC_CPU_IMX6SLL 0x67 43 44 #define MXC_CPU_IMX7D 0x72 44 45 45 46 #define IMX_DDR_TYPE_LPDDR2 1 ··· 78 77 static inline bool cpu_is_imx6ull(void) 79 78 { 80 79 return __mxc_cpu_type == MXC_CPU_IMX6ULL; 80 + } 81 + 82 + static inline bool cpu_is_imx6sll(void) 83 + { 84 + return __mxc_cpu_type == MXC_CPU_IMX6SLL; 81 85 } 82 86 83 87 static inline bool cpu_is_imx6q(void)
+2 -5
arch/arm/mach-imx/pm-imx6.c
··· 428 428 int ret = 0; 429 429 430 430 node = of_find_compatible_node(NULL, NULL, compat); 431 - if (!node) { 432 - ret = -ENODEV; 433 - goto out; 434 - } 431 + if (!node) 432 + return -ENODEV; 435 433 436 434 ret = of_address_to_resource(node, 0, &res); 437 435 if (ret) ··· 442 444 443 445 put_node: 444 446 of_node_put(node); 445 - out: 446 447 return ret; 447 448 } 448 449
+2 -4
arch/arm/mach-mmp/aspenite.c
··· 172 172 }; 173 173 174 174 static struct pxa3xx_nand_platform_data aspenite_nand_info = { 175 - .enable_arbiter = 1, 176 - .num_cs = 1, 177 - .parts[0] = aspenite_nand_partitions, 178 - .nr_parts[0] = ARRAY_SIZE(aspenite_nand_partitions), 175 + .parts = aspenite_nand_partitions, 176 + .nr_parts = ARRAY_SIZE(aspenite_nand_partitions), 179 177 }; 180 178 181 179 static struct i2c_board_info aspenite_i2c_info[] __initdata = {
+3 -6
arch/arm/mach-mmp/ttc_dkb.c
··· 178 178 #endif 179 179 #endif 180 180 181 - #if IS_ENABLED(CONFIG_MTD_NAND_PXA3xx) 182 - static struct pxa3xx_nand_platform_data dkb_nand_info = { 183 - .enable_arbiter = 1, 184 - .num_cs = 1, 185 - }; 181 + #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL) 182 + static struct pxa3xx_nand_platform_data dkb_nand_info = {}; 186 183 #endif 187 184 188 185 #if IS_ENABLED(CONFIG_MMP_DISP) ··· 272 275 273 276 /* on-chip devices */ 274 277 pxa910_add_uart(1); 275 - #if IS_ENABLED(CONFIG_MTD_NAND_PXA3xx) 278 + #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL) 276 279 pxa910_add_nand(&dkb_nand_info); 277 280 #endif 278 281
+30
arch/arm/mach-npcm/Kconfig
··· 1 + menuconfig ARCH_NPCM 2 + bool "Nuvoton NPCM Architecture" 3 + depends on ARCH_MULTI_V7 4 + select PINCTRL 5 + 6 + if ARCH_NPCM 7 + 8 + config ARCH_NPCM7XX 9 + bool "Support for NPCM7xx BMC (Poleg)" 10 + depends on ARCH_MULTI_V7 11 + select PINCTRL_NPCM7XX 12 + select NPCM7XX_TIMER 13 + select ARCH_REQUIRE_GPIOLIB 14 + select CACHE_L2X0 15 + select ARM_GIC 16 + select HAVE_ARM_TWD if SMP 17 + select HAVE_ARM_SCU if SMP 18 + select ARM_ERRATA_764369 if SMP 19 + select ARM_ERRATA_720789 20 + select ARM_ERRATA_754322 21 + select ARM_ERRATA_794072 22 + select PL310_ERRATA_588369 23 + select PL310_ERRATA_727915 24 + select MFD_SYSCON 25 + help 26 + General support for NPCM7xx BMC (Poleg). 27 + 28 + Nuvoton NPCM7xx BMC based on the Cortex A9. 29 + 30 + endif
+4
arch/arm/mach-npcm/Makefile
··· 1 + AFLAGS_headsmp.o += -march=armv7-a 2 + 3 + obj-$(CONFIG_ARCH_NPCM7XX) += npcm7xx.o 4 + obj-$(CONFIG_SMP) += platsmp.o headsmp.o
+17
arch/arm/mach-npcm/headsmp.S
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Copyright (c) 2018 Nuvoton Technology corporation. 3 + // Copyright 2018 Google, Inc. 4 + 5 + #include <linux/linkage.h> 6 + #include <linux/init.h> 7 + #include <asm/assembler.h> 8 + 9 + /* 10 + * The boot ROM does not start secondary CPUs in SVC mode, so we need to do that 11 + * here. 12 + */ 13 + ENTRY(npcm7xx_secondary_startup) 14 + safe_svcmode_maskall r0 15 + 16 + b secondary_startup 17 + ENDPROC(npcm7xx_secondary_startup)
+20
arch/arm/mach-npcm/npcm7xx.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Copyright (c) 2018 Nuvoton Technology corporation. 3 + // Copyright 2018 Google, Inc. 4 + 5 + #include <linux/kernel.h> 6 + #include <linux/types.h> 7 + #include <asm/mach/arch.h> 8 + #include <asm/mach-types.h> 9 + #include <asm/mach/map.h> 10 + #include <asm/hardware/cache-l2x0.h> 11 + 12 + static const char *const npcm7xx_dt_match[] = { 13 + "nuvoton,npcm750", 14 + NULL 15 + }; 16 + 17 + DT_MACHINE_START(NPCM7XX_DT, "NPCM7XX Chip family") 18 + .atag_offset = 0x100, 19 + .dt_compat = npcm7xx_dt_match, 20 + MACHINE_END
+81
arch/arm/mach-npcm/platsmp.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Copyright (c) 2018 Nuvoton Technology corporation. 3 + // Copyright 2018 Google, Inc. 4 + 5 + #define pr_fmt(fmt) "nuvoton,npcm7xx-smp: " fmt 6 + 7 + #include <linux/delay.h> 8 + #include <linux/device.h> 9 + #include <linux/smp.h> 10 + #include <linux/io.h> 11 + #include <linux/of.h> 12 + #include <linux/of_device.h> 13 + #include <linux/of_platform.h> 14 + #include <linux/of_address.h> 15 + #include <asm/cacheflush.h> 16 + #include <asm/smp.h> 17 + #include <asm/smp_plat.h> 18 + #include <asm/smp_scu.h> 19 + 20 + #define NPCM7XX_SCRPAD_REG 0x13c 21 + 22 + extern void npcm7xx_secondary_startup(void); 23 + 24 + static int npcm7xx_smp_boot_secondary(unsigned int cpu, 25 + struct task_struct *idle) 26 + { 27 + struct device_node *gcr_np; 28 + void __iomem *gcr_base; 29 + int ret = 0; 30 + 31 + gcr_np = of_find_compatible_node(NULL, NULL, "nuvoton,npcm750-gcr"); 32 + if (!gcr_np) { 33 + pr_err("no gcr device node\n"); 34 + ret = -ENODEV; 35 + goto out; 36 + } 37 + gcr_base = of_iomap(gcr_np, 0); 38 + if (!gcr_base) { 39 + pr_err("could not iomap gcr"); 40 + ret = -ENOMEM; 41 + goto out; 42 + } 43 + 44 + /* give boot ROM kernel start address. */ 45 + iowrite32(__pa_symbol(npcm7xx_secondary_startup), gcr_base + 46 + NPCM7XX_SCRPAD_REG); 47 + /* make sure the previous write is seen by all observers. */ 48 + dsb_sev(); 49 + 50 + iounmap(gcr_base); 51 + out: 52 + return ret; 53 + } 54 + 55 + static void __init npcm7xx_smp_prepare_cpus(unsigned int max_cpus) 56 + { 57 + struct device_node *scu_np; 58 + void __iomem *scu_base; 59 + 60 + scu_np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-scu"); 61 + if (!scu_np) { 62 + pr_err("no scu device node\n"); 63 + return; 64 + } 65 + scu_base = of_iomap(scu_np, 0); 66 + if (!scu_base) { 67 + pr_err("could not iomap scu"); 68 + return; 69 + } 70 + 71 + scu_enable(scu_base); 72 + 73 + iounmap(scu_base); 74 + } 75 + 76 + static struct smp_operations npcm7xx_smp_ops __initdata = { 77 + .smp_prepare_cpus = npcm7xx_smp_prepare_cpus, 78 + .smp_boot_secondary = npcm7xx_smp_boot_secondary, 79 + }; 80 + 81 + CPU_METHOD_OF_DECLARE(npcm7xx_smp, "nuvoton,npcm750-smp", &npcm7xx_smp_ops);
-6
arch/arm/mach-nspire/nspire.c
··· 33 33 NULL, 34 34 }; 35 35 36 - static void __init nspire_map_io(void) 37 - { 38 - debug_ll_io_init(); 39 - } 40 - 41 36 static struct clcd_board nspire_clcd_data = { 42 37 .name = "LCD", 43 38 .caps = CLCD_CAP_5551 | CLCD_CAP_565, ··· 66 71 67 72 DT_MACHINE_START(NSPIRE, "TI-NSPIRE") 68 73 .dt_compat = nspire_dt_match, 69 - .map_io = nspire_map_io, 70 74 .init_machine = nspire_init, 71 75 .restart = nspire_restart, 72 76 MACHINE_END
+1
arch/arm/mach-omap1/Kconfig
··· 30 30 bool "OMAP16xx Based System" 31 31 select ARCH_OMAP_OTG 32 32 select CPU_ARM926T 33 + select OMAP_DM_TIMER 33 34 34 35 config OMAP_MUX 35 36 bool "OMAP multiplexing support"
+1 -2
arch/arm/mach-omap1/common.h
··· 32 32 33 33 #include <asm/exception.h> 34 34 35 - #include <plat/i2c.h> 36 - 37 35 #include <mach/irqs.h> 38 36 39 37 #include "soc.h" 38 + #include "i2c.h" 40 39 41 40 #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 42 41 void omap7xx_map_io(void);
-2
arch/arm/mach-omap1/i2c.c
··· 24 24 #include <mach/mux.h> 25 25 #include "soc.h" 26 26 27 - #include <plat/i2c.h> 28 - 29 27 #define OMAP_I2C_SIZE 0x3f 30 28 #define OMAP1_I2C_BASE 0xfffb3800 31 29
+1 -1
arch/arm/mach-omap1/pm.c
··· 55 55 #include <mach/tc.h> 56 56 #include <mach/mux.h> 57 57 #include <linux/omap-dma.h> 58 - #include <plat/dmtimer.h> 58 + #include <clocksource/timer-ti-dm.h> 59 59 60 60 #include <mach/irqs.h> 61 61
+1 -1
arch/arm/mach-omap1/timer.c
··· 27 27 #include <linux/platform_device.h> 28 28 #include <linux/platform_data/dmtimer-omap.h> 29 29 30 - #include <plat/dmtimer.h> 30 + #include <clocksource/timer-ti-dm.h> 31 31 32 32 #include "soc.h" 33 33
+1
arch/arm/mach-omap2/Kconfig
··· 72 72 select ARM_ERRATA_754322 73 73 select ARM_ERRATA_775420 74 74 select OMAP_INTERCONNECT 75 + select ARM_CPU_SUSPEND if PM 75 76 76 77 config SOC_DRA7XX 77 78 bool "TI DRA7XX"
+16
arch/arm/mach-omap2/Makefile
··· 88 88 obj-$(CONFIG_ARCH_OMAP4) += $(omap-4-5-pm-common) 89 89 obj-$(CONFIG_SOC_OMAP5) += $(omap-4-5-pm-common) 90 90 obj-$(CONFIG_SOC_DRA7XX) += $(omap-4-5-pm-common) 91 + obj-$(CONFIG_SOC_AM33XX) += pm33xx-core.o sleep33xx.o 92 + obj-$(CONFIG_SOC_AM43XX) += pm33xx-core.o sleep43xx.o 91 93 obj-$(CONFIG_PM_DEBUG) += pm-debug.o 92 94 93 95 obj-$(CONFIG_POWER_AVS_OMAP) += sr_device.o ··· 97 95 98 96 AFLAGS_sleep24xx.o :=-Wa,-march=armv6 99 97 AFLAGS_sleep34xx.o :=-Wa,-march=armv7-a$(plus_sec) 98 + AFLAGS_sleep33xx.o :=-Wa,-march=armv7-a$(plus_sec) 99 + AFLAGS_sleep43xx.o :=-Wa,-march=armv7-a$(plus_sec) 100 100 101 101 endif 102 102 ··· 236 232 obj-y += omap_phy_internal.o 237 233 238 234 obj-$(CONFIG_MACH_OMAP2_TUSB6010) += usb-tusb6010.o 235 + 236 + arch/arm/mach-omap2/pm-asm-offsets.s: arch/arm/mach-omap2/pm-asm-offsets.c 237 + $(call if_changed_dep,cc_s_c) 238 + 239 + include/generated/ti-pm-asm-offsets.h: arch/arm/mach-omap2/pm-asm-offsets.s FORCE 240 + $(call filechk,offsets,__TI_PM_ASM_OFFSETS_H__) 241 + 242 + # For rule to generate ti-emif-asm-offsets.h dependency 243 + include drivers/memory/Makefile.asm-offsets 244 + 245 + arch/arm/mach-omap2/sleep33xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h 246 + arch/arm/mach-omap2/sleep43xx.o: include/generated/ti-pm-asm-offsets.h include/generated/ti-emif-asm-offsets.h
+2 -2
arch/arm/mach-omap2/board-n8x0.c
··· 566 566 } 567 567 #endif 568 568 569 - struct menelaus_platform_data n8x0_menelaus_platform_data __initdata = { 569 + struct menelaus_platform_data n8x0_menelaus_platform_data = { 570 570 .late_init = n8x0_menelaus_late_init, 571 571 }; 572 572 573 - struct aic3x_pdata n810_aic33_data __initdata = { 573 + struct aic3x_pdata n810_aic33_data = { 574 574 .gpio_reset = 118, 575 575 }; 576 576
+7
arch/arm/mach-omap2/common.h
··· 77 77 } 78 78 #endif 79 79 80 + #if defined(CONFIG_PM) && (defined(CONFIG_SOC_AM33XX) || \ 81 + defined(CONFIG_SOC_AM43XX)) 82 + void amx3_common_pm_init(void); 83 + #else 84 + static inline void amx3_common_pm_init(void) { } 85 + #endif 86 + 80 87 extern void omap2_init_common_infrastructure(void); 81 88 82 89 extern void omap_init_time(void);
+16 -4
arch/arm/mach-omap2/control.c
··· 623 623 624 624 struct control_init_data { 625 625 int index; 626 + void __iomem *mem; 626 627 s16 offset; 627 628 }; 628 629 ··· 636 635 .offset = -OMAP2_CONTROL_GENERAL, 637 636 }; 638 637 638 + static const struct control_init_data ctrl_aux_data = { 639 + .index = TI_CLKM_CTRL_AUX, 640 + }; 641 + 639 642 static const struct of_device_id omap_scrm_dt_match_table[] = { 640 643 { .compatible = "ti,am3-scm", .data = &ctrl_data }, 641 644 { .compatible = "ti,am4-scm", .data = &ctrl_data }, ··· 649 644 { .compatible = "ti,dm816-scrm", .data = &ctrl_data }, 650 645 { .compatible = "ti,omap4-scm-core", .data = &ctrl_data }, 651 646 { .compatible = "ti,omap5-scm-core", .data = &ctrl_data }, 647 + { .compatible = "ti,omap5-scm-wkup-pad-conf", .data = &ctrl_aux_data }, 652 648 { .compatible = "ti,dra7-scm-core", .data = &ctrl_data }, 653 649 { } 654 650 }; ··· 666 660 struct device_node *np; 667 661 const struct of_device_id *match; 668 662 struct control_init_data *data; 663 + void __iomem *mem; 669 664 670 665 for_each_matching_node_and_match(np, omap_scrm_dt_match_table, &match) { 671 666 data = (struct control_init_data *)match->data; 672 667 673 - omap2_ctrl_base = of_iomap(np, 0); 674 - if (!omap2_ctrl_base) 668 + mem = of_iomap(np, 0); 669 + if (!mem) 675 670 return -ENOMEM; 676 671 677 - omap2_ctrl_offset = data->offset; 672 + if (data->index == TI_CLKM_CTRL) { 673 + omap2_ctrl_base = mem; 674 + omap2_ctrl_offset = data->offset; 675 + } 676 + 677 + data->mem = mem; 678 678 } 679 679 680 680 return 0; ··· 725 713 } else { 726 714 /* No scm_conf found, direct access */ 727 715 ret = omap2_clk_provider_init(np, data->index, NULL, 728 - omap2_ctrl_base); 716 + data->mem); 729 717 if (ret) 730 718 return ret; 731 719 }
+1 -1
arch/arm/mach-omap2/devices.c
··· 8 8 * the Free Software Foundation; either version 2 of the License, or 9 9 * (at your option) any later version. 10 10 */ 11 - #include <linux/gpio.h> 11 + 12 12 #include <linux/kernel.h> 13 13 #include <linux/init.h> 14 14 #include <linux/platform_device.h>
-2
arch/arm/mach-omap2/hsmmc.c
··· 13 13 #include <linux/slab.h> 14 14 #include <linux/string.h> 15 15 #include <linux/delay.h> 16 - #include <linux/gpio.h> 17 16 #include <linux/mmc/host.h> 18 - #include <linux/platform_data/gpio-omap.h> 19 17 #include <linux/platform_data/hsmmc-omap.h> 20 18 21 19 #include "soc.h"
+1 -14
arch/arm/mach-omap2/i2c.h
··· 19 19 * 20 20 */ 21 21 22 - #include <plat/i2c.h> 23 - 24 22 #ifndef __MACH_OMAP2_I2C_H 25 23 #define __MACH_OMAP2_I2C_H 26 24 27 - /** 28 - * i2c_dev_attr - OMAP I2C controller device attributes for omap_hwmod 29 - * @fifo_depth: total controller FIFO size (in bytes) 30 - * @flags: differences in hardware support capability 31 - * 32 - * @fifo_depth represents what exists on the hardware, not what is 33 - * actually configured at runtime by the device driver. 34 - */ 35 - struct omap_i2c_dev_attr { 36 - u8 fifo_depth; 37 - u32 flags; 38 - }; 25 + struct omap_hwmod; 39 26 40 27 int omap_i2c_reset(struct omap_hwmod *oh); 41 28
+2
arch/arm/mach-omap2/io.c
··· 622 622 void __init am33xx_init_late(void) 623 623 { 624 624 omap_common_late_init(); 625 + amx3_common_pm_init(); 625 626 } 626 627 #endif 627 628 ··· 647 646 { 648 647 omap_common_late_init(); 649 648 omap2_clk_enable_autoidle_all(); 649 + amx3_common_pm_init(); 650 650 } 651 651 #endif 652 652
-1
arch/arm/mach-omap2/msdi.c
··· 23 23 24 24 #include <linux/kernel.h> 25 25 #include <linux/err.h> 26 - #include <linux/platform_data/gpio-omap.h> 27 26 28 27 #include "prm.h" 29 28 #include "common.h"
+1 -1
arch/arm/mach-omap2/omap4-sar-layout.h
··· 28 28 #define L2X0_AUXCTRL_OFFSET 0xff8 29 29 #define L2X0_PREFETCH_CTRL_OFFSET 0xffc 30 30 31 - /* CPUx Wakeup Non-Secure Physical Address offsets in SAR_BANK3 */ 31 + /* CPUx Wakeup Non-Secure Physical Address offsets in SAR_BANK1 */ 32 32 #define CPU0_WAKEUP_NS_PA_ADDR_OFFSET 0xa04 33 33 #define CPU1_WAKEUP_NS_PA_ADDR_OFFSET 0xa08 34 34 #define OMAP5_CPU0_WAKEUP_NS_PA_ADDR_OFFSET 0xe00
+5
arch/arm/mach-omap2/omap_device.c
··· 140 140 struct omap_device *od; 141 141 struct omap_hwmod *oh; 142 142 struct device_node *node = pdev->dev.of_node; 143 + struct resource res; 143 144 const char *oh_name; 144 145 int oh_cnt, i, ret = 0; 145 146 bool device_active = false; ··· 150 149 dev_dbg(&pdev->dev, "No 'hwmods' to build omap_device\n"); 151 150 return -ENODEV; 152 151 } 152 + 153 + /* Use ti-sysc driver instead of omap_device? */ 154 + if (!omap_hwmod_parse_module_range(NULL, node, &res)) 155 + return -ENODEV; 153 156 154 157 hwmods = kzalloc(sizeof(struct omap_hwmod *) * oh_cnt, GFP_KERNEL); 155 158 if (!hwmods) {
+417 -1
arch/arm/mach-omap2/omap_hwmod.c
··· 145 145 146 146 #include <linux/platform_data/ti-sysc.h> 147 147 148 + #include <dt-bindings/bus/ti-sysc.h> 149 + 148 150 #include <asm/system_misc.h> 149 151 150 152 #include "clock.h" ··· 2500 2498 * affects the IP block hardware, or system integration hardware 2501 2499 * associated with the IP block. Returns 0. 2502 2500 */ 2503 - static int __init _setup(struct omap_hwmod *oh, void *data) 2501 + static int _setup(struct omap_hwmod *oh, void *data) 2504 2502 { 2505 2503 if (oh->_state != _HWMOD_STATE_INITIALIZED) 2506 2504 return 0; ··· 3062 3060 return 0; 3063 3061 } 3064 3062 3063 + static void omap_hwmod_check_one(struct device *dev, 3064 + const char *name, s8 v1, u8 v2) 3065 + { 3066 + if (v1 < 0) 3067 + return; 3068 + 3069 + if (v1 != v2) 3070 + dev_warn(dev, "%s %d != %d\n", name, v1, v2); 3071 + } 3072 + 3073 + /** 3074 + * omap_hwmod_check_sysc - check sysc against platform sysc 3075 + * @dev: struct device 3076 + * @data: module data 3077 + * @sysc_fields: new sysc configuration 3078 + */ 3079 + static int omap_hwmod_check_sysc(struct device *dev, 3080 + const struct ti_sysc_module_data *data, 3081 + struct sysc_regbits *sysc_fields) 3082 + { 3083 + const struct sysc_regbits *regbits = data->cap->regbits; 3084 + 3085 + omap_hwmod_check_one(dev, "dmadisable_shift", 3086 + regbits->dmadisable_shift, 3087 + sysc_fields->dmadisable_shift); 3088 + omap_hwmod_check_one(dev, "midle_shift", 3089 + regbits->midle_shift, 3090 + sysc_fields->midle_shift); 3091 + omap_hwmod_check_one(dev, "sidle_shift", 3092 + regbits->sidle_shift, 3093 + sysc_fields->sidle_shift); 3094 + omap_hwmod_check_one(dev, "clkact_shift", 3095 + regbits->clkact_shift, 3096 + sysc_fields->clkact_shift); 3097 + omap_hwmod_check_one(dev, "enwkup_shift", 3098 + regbits->enwkup_shift, 3099 + sysc_fields->enwkup_shift); 3100 + omap_hwmod_check_one(dev, "srst_shift", 3101 + regbits->srst_shift, 3102 + sysc_fields->srst_shift); 3103 + omap_hwmod_check_one(dev, "autoidle_shift", 3104 + regbits->autoidle_shift, 3105 + sysc_fields->autoidle_shift); 3106 + 3107 + return 0; 3108 + } 3109 + 3110 + /** 3111 + * omap_hwmod_init_regbits - init sysconfig specific register bits 3112 + * @dev: struct device 3113 + * @data: module data 3114 + * @sysc_fields: new sysc configuration 3115 + */ 3116 + static int omap_hwmod_init_regbits(struct device *dev, 3117 + const struct ti_sysc_module_data *data, 3118 + struct sysc_regbits **sysc_fields) 3119 + { 3120 + *sysc_fields = NULL; 3121 + 3122 + switch (data->cap->type) { 3123 + case TI_SYSC_OMAP2: 3124 + case TI_SYSC_OMAP2_TIMER: 3125 + *sysc_fields = &omap_hwmod_sysc_type1; 3126 + break; 3127 + case TI_SYSC_OMAP3_SHAM: 3128 + *sysc_fields = &omap3_sham_sysc_fields; 3129 + break; 3130 + case TI_SYSC_OMAP3_AES: 3131 + *sysc_fields = &omap3xxx_aes_sysc_fields; 3132 + break; 3133 + case TI_SYSC_OMAP4: 3134 + case TI_SYSC_OMAP4_TIMER: 3135 + *sysc_fields = &omap_hwmod_sysc_type2; 3136 + break; 3137 + case TI_SYSC_OMAP4_SIMPLE: 3138 + *sysc_fields = &omap_hwmod_sysc_type3; 3139 + break; 3140 + case TI_SYSC_OMAP34XX_SR: 3141 + *sysc_fields = &omap34xx_sr_sysc_fields; 3142 + break; 3143 + case TI_SYSC_OMAP36XX_SR: 3144 + *sysc_fields = &omap36xx_sr_sysc_fields; 3145 + break; 3146 + case TI_SYSC_OMAP4_SR: 3147 + *sysc_fields = &omap36xx_sr_sysc_fields; 3148 + break; 3149 + case TI_SYSC_OMAP4_MCASP: 3150 + *sysc_fields = &omap_hwmod_sysc_type_mcasp; 3151 + break; 3152 + case TI_SYSC_OMAP4_USB_HOST_FS: 3153 + *sysc_fields = &omap_hwmod_sysc_type_usb_host_fs; 3154 + break; 3155 + default: 3156 + return -EINVAL; 3157 + } 3158 + 3159 + return omap_hwmod_check_sysc(dev, data, *sysc_fields); 3160 + } 3161 + 3162 + /** 3163 + * omap_hwmod_init_reg_offs - initialize sysconfig register offsets 3164 + * @dev: struct device 3165 + * @data: module data 3166 + * @rev_offs: revision register offset 3167 + * @sysc_offs: sysc register offset 3168 + * @syss_offs: syss register offset 3169 + */ 3170 + int omap_hwmod_init_reg_offs(struct device *dev, 3171 + const struct ti_sysc_module_data *data, 3172 + u32 *rev_offs, u32 *sysc_offs, u32 *syss_offs) 3173 + { 3174 + *rev_offs = 0; 3175 + *sysc_offs = 0; 3176 + *syss_offs = 0; 3177 + 3178 + if (data->offsets[SYSC_REVISION] > 0) 3179 + *rev_offs = data->offsets[SYSC_REVISION]; 3180 + 3181 + if (data->offsets[SYSC_SYSCONFIG] > 0) 3182 + *sysc_offs = data->offsets[SYSC_SYSCONFIG]; 3183 + 3184 + if (data->offsets[SYSC_SYSSTATUS] > 0) 3185 + *syss_offs = data->offsets[SYSC_SYSSTATUS]; 3186 + 3187 + return 0; 3188 + } 3189 + 3190 + /** 3191 + * omap_hwmod_init_sysc_flags - initialize sysconfig features 3192 + * @dev: struct device 3193 + * @data: module data 3194 + * @sysc_flags: module configuration 3195 + */ 3196 + int omap_hwmod_init_sysc_flags(struct device *dev, 3197 + const struct ti_sysc_module_data *data, 3198 + u32 *sysc_flags) 3199 + { 3200 + *sysc_flags = 0; 3201 + 3202 + switch (data->cap->type) { 3203 + case TI_SYSC_OMAP2: 3204 + case TI_SYSC_OMAP2_TIMER: 3205 + /* See SYSC_OMAP2_* in include/dt-bindings/bus/ti-sysc.h */ 3206 + if (data->cfg->sysc_val & SYSC_OMAP2_CLOCKACTIVITY) 3207 + *sysc_flags |= SYSC_HAS_CLOCKACTIVITY; 3208 + if (data->cfg->sysc_val & SYSC_OMAP2_EMUFREE) 3209 + *sysc_flags |= SYSC_HAS_EMUFREE; 3210 + if (data->cfg->sysc_val & SYSC_OMAP2_ENAWAKEUP) 3211 + *sysc_flags |= SYSC_HAS_ENAWAKEUP; 3212 + if (data->cfg->sysc_val & SYSC_OMAP2_SOFTRESET) 3213 + *sysc_flags |= SYSC_HAS_SOFTRESET; 3214 + if (data->cfg->sysc_val & SYSC_OMAP2_AUTOIDLE) 3215 + *sysc_flags |= SYSC_HAS_AUTOIDLE; 3216 + break; 3217 + case TI_SYSC_OMAP4: 3218 + case TI_SYSC_OMAP4_TIMER: 3219 + /* See SYSC_OMAP4_* in include/dt-bindings/bus/ti-sysc.h */ 3220 + if (data->cfg->sysc_val & SYSC_OMAP4_DMADISABLE) 3221 + *sysc_flags |= SYSC_HAS_DMADISABLE; 3222 + if (data->cfg->sysc_val & SYSC_OMAP4_FREEEMU) 3223 + *sysc_flags |= SYSC_HAS_EMUFREE; 3224 + if (data->cfg->sysc_val & SYSC_OMAP4_SOFTRESET) 3225 + *sysc_flags |= SYSC_HAS_SOFTRESET; 3226 + break; 3227 + case TI_SYSC_OMAP34XX_SR: 3228 + case TI_SYSC_OMAP36XX_SR: 3229 + /* See SYSC_OMAP3_SR_* in include/dt-bindings/bus/ti-sysc.h */ 3230 + if (data->cfg->sysc_val & SYSC_OMAP3_SR_ENAWAKEUP) 3231 + *sysc_flags |= SYSC_HAS_ENAWAKEUP; 3232 + break; 3233 + default: 3234 + if (data->cap->regbits->emufree_shift >= 0) 3235 + *sysc_flags |= SYSC_HAS_EMUFREE; 3236 + if (data->cap->regbits->enwkup_shift >= 0) 3237 + *sysc_flags |= SYSC_HAS_ENAWAKEUP; 3238 + if (data->cap->regbits->srst_shift >= 0) 3239 + *sysc_flags |= SYSC_HAS_SOFTRESET; 3240 + if (data->cap->regbits->autoidle_shift >= 0) 3241 + *sysc_flags |= SYSC_HAS_AUTOIDLE; 3242 + break; 3243 + } 3244 + 3245 + if (data->cap->regbits->midle_shift >= 0 && 3246 + data->cfg->midlemodes) 3247 + *sysc_flags |= SYSC_HAS_MIDLEMODE; 3248 + 3249 + if (data->cap->regbits->sidle_shift >= 0 && 3250 + data->cfg->sidlemodes) 3251 + *sysc_flags |= SYSC_HAS_SIDLEMODE; 3252 + 3253 + if (data->cfg->quirks & SYSC_QUIRK_UNCACHED) 3254 + *sysc_flags |= SYSC_NO_CACHE; 3255 + if (data->cfg->quirks & SYSC_QUIRK_RESET_STATUS) 3256 + *sysc_flags |= SYSC_HAS_RESET_STATUS; 3257 + 3258 + if (data->cfg->syss_mask & 1) 3259 + *sysc_flags |= SYSS_HAS_RESET_STATUS; 3260 + 3261 + return 0; 3262 + } 3263 + 3264 + /** 3265 + * omap_hwmod_init_idlemodes - initialize module idle modes 3266 + * @dev: struct device 3267 + * @data: module data 3268 + * @idlemodes: module supported idle modes 3269 + */ 3270 + int omap_hwmod_init_idlemodes(struct device *dev, 3271 + const struct ti_sysc_module_data *data, 3272 + u32 *idlemodes) 3273 + { 3274 + *idlemodes = 0; 3275 + 3276 + if (data->cfg->midlemodes & BIT(SYSC_IDLE_FORCE)) 3277 + *idlemodes |= MSTANDBY_FORCE; 3278 + if (data->cfg->midlemodes & BIT(SYSC_IDLE_NO)) 3279 + *idlemodes |= MSTANDBY_NO; 3280 + if (data->cfg->midlemodes & BIT(SYSC_IDLE_SMART)) 3281 + *idlemodes |= MSTANDBY_SMART; 3282 + if (data->cfg->midlemodes & BIT(SYSC_IDLE_SMART_WKUP)) 3283 + *idlemodes |= MSTANDBY_SMART_WKUP; 3284 + 3285 + if (data->cfg->sidlemodes & BIT(SYSC_IDLE_FORCE)) 3286 + *idlemodes |= SIDLE_FORCE; 3287 + if (data->cfg->sidlemodes & BIT(SYSC_IDLE_NO)) 3288 + *idlemodes |= SIDLE_NO; 3289 + if (data->cfg->sidlemodes & BIT(SYSC_IDLE_SMART)) 3290 + *idlemodes |= SIDLE_SMART; 3291 + if (data->cfg->sidlemodes & BIT(SYSC_IDLE_SMART_WKUP)) 3292 + *idlemodes |= SIDLE_SMART_WKUP; 3293 + 3294 + return 0; 3295 + } 3296 + 3297 + /** 3298 + * omap_hwmod_check_module - check new module against platform data 3299 + * @dev: struct device 3300 + * @oh: module 3301 + * @data: new module data 3302 + * @sysc_fields: sysc register bits 3303 + * @rev_offs: revision register offset 3304 + * @sysc_offs: sysconfig register offset 3305 + * @syss_offs: sysstatus register offset 3306 + * @sysc_flags: sysc specific flags 3307 + * @idlemodes: sysc supported idlemodes 3308 + */ 3309 + static int omap_hwmod_check_module(struct device *dev, 3310 + struct omap_hwmod *oh, 3311 + const struct ti_sysc_module_data *data, 3312 + struct sysc_regbits *sysc_fields, 3313 + u32 rev_offs, u32 sysc_offs, 3314 + u32 syss_offs, u32 sysc_flags, 3315 + u32 idlemodes) 3316 + { 3317 + if (!oh->class->sysc) 3318 + return -ENODEV; 3319 + 3320 + if (sysc_fields != oh->class->sysc->sysc_fields) 3321 + dev_warn(dev, "sysc_fields %p != %p\n", sysc_fields, 3322 + oh->class->sysc->sysc_fields); 3323 + 3324 + if (rev_offs != oh->class->sysc->rev_offs) 3325 + dev_warn(dev, "rev_offs %08x != %08x\n", rev_offs, 3326 + oh->class->sysc->rev_offs); 3327 + if (sysc_offs != oh->class->sysc->sysc_offs) 3328 + dev_warn(dev, "sysc_offs %08x != %08x\n", sysc_offs, 3329 + oh->class->sysc->sysc_offs); 3330 + if (syss_offs != oh->class->sysc->syss_offs) 3331 + dev_warn(dev, "syss_offs %08x != %08x\n", syss_offs, 3332 + oh->class->sysc->syss_offs); 3333 + 3334 + if (sysc_flags != oh->class->sysc->sysc_flags) 3335 + dev_warn(dev, "sysc_flags %08x != %08x\n", sysc_flags, 3336 + oh->class->sysc->sysc_flags); 3337 + 3338 + if (idlemodes != oh->class->sysc->idlemodes) 3339 + dev_warn(dev, "idlemodes %08x != %08x\n", idlemodes, 3340 + oh->class->sysc->idlemodes); 3341 + 3342 + if (data->cfg->srst_udelay != oh->class->sysc->srst_udelay) 3343 + dev_warn(dev, "srst_udelay %i != %i\n", 3344 + data->cfg->srst_udelay, 3345 + oh->class->sysc->srst_udelay); 3346 + 3347 + return 0; 3348 + } 3349 + 3350 + /** 3351 + * omap_hwmod_allocate_module - allocate new module 3352 + * @dev: struct device 3353 + * @oh: module 3354 + * @sysc_fields: sysc register bits 3355 + * @rev_offs: revision register offset 3356 + * @sysc_offs: sysconfig register offset 3357 + * @syss_offs: sysstatus register offset 3358 + * @sysc_flags: sysc specific flags 3359 + * @idlemodes: sysc supported idlemodes 3360 + * 3361 + * Note that the allocations here cannot use devm as ti-sysc can rebind. 3362 + */ 3363 + int omap_hwmod_allocate_module(struct device *dev, struct omap_hwmod *oh, 3364 + const struct ti_sysc_module_data *data, 3365 + struct sysc_regbits *sysc_fields, 3366 + u32 rev_offs, u32 sysc_offs, u32 syss_offs, 3367 + u32 sysc_flags, u32 idlemodes) 3368 + { 3369 + struct omap_hwmod_class_sysconfig *sysc; 3370 + struct omap_hwmod_class *class; 3371 + void __iomem *regs = NULL; 3372 + unsigned long flags; 3373 + 3374 + sysc = kzalloc(sizeof(*sysc), GFP_KERNEL); 3375 + if (!sysc) 3376 + return -ENOMEM; 3377 + 3378 + sysc->sysc_fields = sysc_fields; 3379 + sysc->rev_offs = rev_offs; 3380 + sysc->sysc_offs = sysc_offs; 3381 + sysc->syss_offs = syss_offs; 3382 + sysc->sysc_flags = sysc_flags; 3383 + sysc->idlemodes = idlemodes; 3384 + sysc->srst_udelay = data->cfg->srst_udelay; 3385 + 3386 + if (!oh->_mpu_rt_va) { 3387 + regs = ioremap(data->module_pa, 3388 + data->module_size); 3389 + if (!regs) 3390 + return -ENOMEM; 3391 + } 3392 + 3393 + /* 3394 + * We need new oh->class as the other devices in the same class 3395 + * may not yet have ioremapped their registers. 3396 + */ 3397 + class = kmemdup(oh->class, sizeof(*oh->class), GFP_KERNEL); 3398 + if (!class) 3399 + return -ENOMEM; 3400 + 3401 + class->sysc = sysc; 3402 + 3403 + spin_lock_irqsave(&oh->_lock, flags); 3404 + if (regs) 3405 + oh->_mpu_rt_va = regs; 3406 + oh->class = class; 3407 + oh->_state = _HWMOD_STATE_INITIALIZED; 3408 + _setup(oh, NULL); 3409 + spin_unlock_irqrestore(&oh->_lock, flags); 3410 + 3411 + return 0; 3412 + } 3413 + 3414 + /** 3415 + * omap_hwmod_init_module - initialize new module 3416 + * @dev: struct device 3417 + * @data: module data 3418 + * @cookie: cookie for the caller to use for later calls 3419 + */ 3420 + int omap_hwmod_init_module(struct device *dev, 3421 + const struct ti_sysc_module_data *data, 3422 + struct ti_sysc_cookie *cookie) 3423 + { 3424 + struct omap_hwmod *oh; 3425 + struct sysc_regbits *sysc_fields; 3426 + u32 rev_offs, sysc_offs, syss_offs, sysc_flags, idlemodes; 3427 + int error; 3428 + 3429 + if (!dev || !data) 3430 + return -EINVAL; 3431 + 3432 + oh = _lookup(data->name); 3433 + if (!oh) 3434 + return -ENODEV; 3435 + 3436 + cookie->data = oh; 3437 + 3438 + error = omap_hwmod_init_regbits(dev, data, &sysc_fields); 3439 + if (error) 3440 + return error; 3441 + 3442 + error = omap_hwmod_init_reg_offs(dev, data, &rev_offs, 3443 + &sysc_offs, &syss_offs); 3444 + if (error) 3445 + return error; 3446 + 3447 + error = omap_hwmod_init_sysc_flags(dev, data, &sysc_flags); 3448 + if (error) 3449 + return error; 3450 + 3451 + error = omap_hwmod_init_idlemodes(dev, data, &idlemodes); 3452 + if (error) 3453 + return error; 3454 + 3455 + if (data->cfg->quirks & SYSC_QUIRK_NO_IDLE_ON_INIT) 3456 + oh->flags |= HWMOD_INIT_NO_IDLE; 3457 + if (data->cfg->quirks & SYSC_QUIRK_NO_RESET_ON_INIT) 3458 + oh->flags |= HWMOD_INIT_NO_RESET; 3459 + 3460 + error = omap_hwmod_check_module(dev, oh, data, sysc_fields, 3461 + rev_offs, sysc_offs, syss_offs, 3462 + sysc_flags, idlemodes); 3463 + if (!error) 3464 + return error; 3465 + 3466 + return omap_hwmod_allocate_module(dev, oh, data, sysc_fields, 3467 + rev_offs, sysc_offs, syss_offs, 3468 + sysc_flags, idlemodes); 3469 + } 3470 + 3065 3471 /** 3066 3472 * omap_hwmod_setup_earlycon_flags - set up flags for early console 3067 3473 * ··· 3492 3082 if (np) { 3493 3083 uart = of_get_property(np, "ti,hwmods", NULL); 3494 3084 oh = omap_hwmod_lookup(uart); 3085 + if (!oh) { 3086 + uart = of_get_property(np->parent, 3087 + "ti,hwmods", 3088 + NULL); 3089 + oh = omap_hwmod_lookup(uart); 3090 + } 3495 3091 if (oh) 3496 3092 oh->flags |= DEBUG_OMAPUART_FLAGS; 3497 3093 }
+7
arch/arm/mach-omap2/omap_hwmod.h
··· 620 620 struct device_node *np, 621 621 struct resource *res); 622 622 623 + struct ti_sysc_module_data; 624 + struct ti_sysc_cookie; 625 + 626 + int omap_hwmod_init_module(struct device *dev, 627 + const struct ti_sysc_module_data *data, 628 + struct ti_sysc_cookie *cookie); 629 + 623 630 int omap_hwmod_enable(struct omap_hwmod *oh); 624 631 int omap_hwmod_idle(struct omap_hwmod *oh); 625 632 int omap_hwmod_shutdown(struct omap_hwmod *oh);
-11
arch/arm/mach-omap2/omap_hwmod_2420_data.c
··· 14 14 */ 15 15 16 16 #include <linux/i2c-omap.h> 17 - #include <linux/platform_data/spi-omap2-mcspi.h> 18 17 #include <linux/omap-dma.h> 19 - #include <plat/dmtimer.h> 20 18 21 19 #include "omap_hwmod.h" 22 20 #include "l3_2xxx.h" ··· 95 97 .reset = &omap_i2c_reset, 96 98 }; 97 99 98 - static struct omap_i2c_dev_attr i2c_dev_attr = { 99 - .flags = OMAP_I2C_FLAG_NO_FIFO | 100 - OMAP_I2C_FLAG_SIMPLE_CLOCK | 101 - OMAP_I2C_FLAG_16BIT_DATA_REG | 102 - OMAP_I2C_FLAG_BUS_SHIFT_2, 103 - }; 104 - 105 100 /* I2C1 */ 106 101 static struct omap_hwmod omap2420_i2c1_hwmod = { 107 102 .name = "i2c1", ··· 107 116 }, 108 117 }, 109 118 .class = &i2c_class, 110 - .dev_attr = &i2c_dev_attr, 111 119 /* 112 120 * From mach-omap2/pm24xx.c: "Putting MPU into the WFI state 113 121 * while a transfer is active seems to cause the I2C block to ··· 127 137 }, 128 138 }, 129 139 .class = &i2c_class, 130 - .dev_attr = &i2c_dev_attr, 131 140 .flags = HWMOD_16BIT_REG, 132 141 }; 133 142
-18
arch/arm/mach-omap2/omap_hwmod_2430_data.c
··· 14 14 */ 15 15 16 16 #include <linux/i2c-omap.h> 17 - #include <linux/platform_data/asoc-ti-mcbsp.h> 18 17 #include <linux/platform_data/hsmmc-omap.h> 19 - #include <linux/platform_data/spi-omap2-mcspi.h> 20 18 #include <linux/omap-dma.h> 21 - #include <plat/dmtimer.h> 22 19 23 20 #include "omap_hwmod.h" 24 21 #include "l3_2xxx.h" ··· 72 75 .reset = &omap_i2c_reset, 73 76 }; 74 77 75 - static struct omap_i2c_dev_attr i2c_dev_attr = { 76 - .fifo_depth = 8, /* bytes */ 77 - .flags = OMAP_I2C_FLAG_BUS_SHIFT_2 | 78 - OMAP_I2C_FLAG_FORCE_19200_INT_CLK, 79 - }; 80 - 81 78 /* I2C1 */ 82 79 static struct omap_hwmod omap2430_i2c1_hwmod = { 83 80 .name = "i2c1", ··· 93 102 }, 94 103 }, 95 104 .class = &i2c_class, 96 - .dev_attr = &i2c_dev_attr, 97 105 }; 98 106 99 107 /* I2C2 */ ··· 108 118 }, 109 119 }, 110 120 .class = &i2c_class, 111 - .dev_attr = &i2c_dev_attr, 112 121 }; 113 122 114 123 /* gpio5 */ ··· 123 134 }, 124 135 }, 125 136 .class = &omap2xxx_gpio_hwmod_class, 126 - .dev_attr = &omap2xxx_gpio_dev_attr, 127 137 }; 128 138 129 139 /* dma attributes */ ··· 155 167 }; 156 168 157 169 /* mcspi3 */ 158 - static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = { 159 - .num_chipselect = 2, 160 - }; 161 - 162 170 static struct omap_hwmod omap2430_mcspi3_hwmod = { 163 171 .name = "mcspi3", 164 172 .main_clk = "mcspi3_fck", ··· 166 182 }, 167 183 }, 168 184 .class = &omap2xxx_mcspi_class, 169 - .dev_attr = &omap_mcspi3_dev_attr, 170 185 }; 171 186 172 187 /* usbhsotg */ ··· 222 239 static struct omap_hwmod_class omap2430_mcbsp_hwmod_class = { 223 240 .name = "mcbsp", 224 241 .sysc = &omap2430_mcbsp_sysc, 225 - .rev = MCBSP_CONFIG_TYPE2, 226 242 }; 227 243 228 244 static struct omap_hwmod_opt_clk mcbsp_opt_clks[] = {
+1 -60
arch/arm/mach-omap2/omap_hwmod_2xxx_ipblock_data.c
··· 9 9 * published by the Free Software Foundation. 10 10 */ 11 11 12 - #include <linux/platform_data/gpio-omap.h> 12 + #include <linux/types.h> 13 13 #include <linux/omap-dma.h> 14 - #include <plat/dmtimer.h> 15 - #include <linux/platform_data/spi-omap2-mcspi.h> 16 14 17 15 #include "omap_hwmod.h" 18 16 #include "omap_hwmod_common_data.h" ··· 157 159 struct omap_hwmod_class omap2xxx_mcspi_class = { 158 160 .name = "mcspi", 159 161 .sysc = &omap2xxx_mcspi_sysc, 160 - .rev = OMAP2_MCSPI_REV, 161 162 }; 162 163 163 164 /* ··· 217 220 .class = &iva_hwmod_class, 218 221 }; 219 222 220 - /* always-on timers dev attribute */ 221 - static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = { 222 - .timer_capability = OMAP_TIMER_ALWON, 223 - }; 224 - 225 - /* pwm timers dev attribute */ 226 - static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = { 227 - .timer_capability = OMAP_TIMER_HAS_PWM, 228 - }; 229 - 230 - /* timers with DSP interrupt dev attribute */ 231 - static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = { 232 - .timer_capability = OMAP_TIMER_HAS_DSP_IRQ, 233 - }; 234 - 235 223 /* timer1 */ 236 - 237 224 struct omap_hwmod omap2xxx_timer1_hwmod = { 238 225 .name = "timer1", 239 226 .main_clk = "gpt1_fck", ··· 228 247 .idlest_idle_bit = OMAP24XX_ST_GPT1_SHIFT, 229 248 }, 230 249 }, 231 - .dev_attr = &capability_alwon_dev_attr, 232 250 .class = &omap2xxx_timer_hwmod_class, 233 251 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 234 252 }; 235 253 236 254 /* timer2 */ 237 - 238 255 struct omap_hwmod omap2xxx_timer2_hwmod = { 239 256 .name = "timer2", 240 257 .main_clk = "gpt2_fck", ··· 248 269 }; 249 270 250 271 /* timer3 */ 251 - 252 272 struct omap_hwmod omap2xxx_timer3_hwmod = { 253 273 .name = "timer3", 254 274 .main_clk = "gpt3_fck", ··· 263 285 }; 264 286 265 287 /* timer4 */ 266 - 267 288 struct omap_hwmod omap2xxx_timer4_hwmod = { 268 289 .name = "timer4", 269 290 .main_clk = "gpt4_fck", ··· 278 301 }; 279 302 280 303 /* timer5 */ 281 - 282 304 struct omap_hwmod omap2xxx_timer5_hwmod = { 283 305 .name = "timer5", 284 306 .main_clk = "gpt5_fck", ··· 288 312 .idlest_idle_bit = OMAP24XX_ST_GPT5_SHIFT, 289 313 }, 290 314 }, 291 - .dev_attr = &capability_dsp_dev_attr, 292 315 .class = &omap2xxx_timer_hwmod_class, 293 316 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 294 317 }; 295 318 296 319 /* timer6 */ 297 - 298 320 struct omap_hwmod omap2xxx_timer6_hwmod = { 299 321 .name = "timer6", 300 322 .main_clk = "gpt6_fck", ··· 303 329 .idlest_idle_bit = OMAP24XX_ST_GPT6_SHIFT, 304 330 }, 305 331 }, 306 - .dev_attr = &capability_dsp_dev_attr, 307 332 .class = &omap2xxx_timer_hwmod_class, 308 333 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 309 334 }; 310 335 311 336 /* timer7 */ 312 - 313 337 struct omap_hwmod omap2xxx_timer7_hwmod = { 314 338 .name = "timer7", 315 339 .main_clk = "gpt7_fck", ··· 318 346 .idlest_idle_bit = OMAP24XX_ST_GPT7_SHIFT, 319 347 }, 320 348 }, 321 - .dev_attr = &capability_dsp_dev_attr, 322 349 .class = &omap2xxx_timer_hwmod_class, 323 350 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 324 351 }; 325 352 326 353 /* timer8 */ 327 - 328 354 struct omap_hwmod omap2xxx_timer8_hwmod = { 329 355 .name = "timer8", 330 356 .main_clk = "gpt8_fck", ··· 333 363 .idlest_idle_bit = OMAP24XX_ST_GPT8_SHIFT, 334 364 }, 335 365 }, 336 - .dev_attr = &capability_dsp_dev_attr, 337 366 .class = &omap2xxx_timer_hwmod_class, 338 367 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 339 368 }; 340 369 341 370 /* timer9 */ 342 - 343 371 struct omap_hwmod omap2xxx_timer9_hwmod = { 344 372 .name = "timer9", 345 373 .main_clk = "gpt9_fck", ··· 348 380 .idlest_idle_bit = OMAP24XX_ST_GPT9_SHIFT, 349 381 }, 350 382 }, 351 - .dev_attr = &capability_pwm_dev_attr, 352 383 .class = &omap2xxx_timer_hwmod_class, 353 384 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 354 385 }; 355 386 356 387 /* timer10 */ 357 - 358 388 struct omap_hwmod omap2xxx_timer10_hwmod = { 359 389 .name = "timer10", 360 390 .main_clk = "gpt10_fck", ··· 363 397 .idlest_idle_bit = OMAP24XX_ST_GPT10_SHIFT, 364 398 }, 365 399 }, 366 - .dev_attr = &capability_pwm_dev_attr, 367 400 .class = &omap2xxx_timer_hwmod_class, 368 401 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 369 402 }; 370 403 371 404 /* timer11 */ 372 - 373 405 struct omap_hwmod omap2xxx_timer11_hwmod = { 374 406 .name = "timer11", 375 407 .main_clk = "gpt11_fck", ··· 378 414 .idlest_idle_bit = OMAP24XX_ST_GPT11_SHIFT, 379 415 }, 380 416 }, 381 - .dev_attr = &capability_pwm_dev_attr, 382 417 .class = &omap2xxx_timer_hwmod_class, 383 418 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 384 419 }; 385 420 386 421 /* timer12 */ 387 - 388 422 struct omap_hwmod omap2xxx_timer12_hwmod = { 389 423 .name = "timer12", 390 424 .main_clk = "gpt12_fck", ··· 393 431 .idlest_idle_bit = OMAP24XX_ST_GPT12_SHIFT, 394 432 }, 395 433 }, 396 - .dev_attr = &capability_pwm_dev_attr, 397 434 .class = &omap2xxx_timer_hwmod_class, 398 435 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 399 436 }; ··· 529 568 .flags = HWMOD_NO_IDLEST, 530 569 }; 531 570 532 - /* gpio dev_attr */ 533 - struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr = { 534 - .bank_width = 32, 535 - .dbck_flag = false, 536 - }; 537 - 538 571 /* gpio1 */ 539 572 struct omap_hwmod omap2xxx_gpio1_hwmod = { 540 573 .name = "gpio1", ··· 542 587 }, 543 588 }, 544 589 .class = &omap2xxx_gpio_hwmod_class, 545 - .dev_attr = &omap2xxx_gpio_dev_attr, 546 590 }; 547 591 548 592 /* gpio2 */ ··· 557 603 }, 558 604 }, 559 605 .class = &omap2xxx_gpio_hwmod_class, 560 - .dev_attr = &omap2xxx_gpio_dev_attr, 561 606 }; 562 607 563 608 /* gpio3 */ ··· 572 619 }, 573 620 }, 574 621 .class = &omap2xxx_gpio_hwmod_class, 575 - .dev_attr = &omap2xxx_gpio_dev_attr, 576 622 }; 577 623 578 624 /* gpio4 */ ··· 587 635 }, 588 636 }, 589 637 .class = &omap2xxx_gpio_hwmod_class, 590 - .dev_attr = &omap2xxx_gpio_dev_attr, 591 638 }; 592 639 593 640 /* mcspi1 */ 594 - static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = { 595 - .num_chipselect = 4, 596 - }; 597 - 598 641 struct omap_hwmod omap2xxx_mcspi1_hwmod = { 599 642 .name = "mcspi1", 600 643 .main_clk = "mcspi1_fck", ··· 601 654 }, 602 655 }, 603 656 .class = &omap2xxx_mcspi_class, 604 - .dev_attr = &omap_mcspi1_dev_attr, 605 657 }; 606 658 607 659 /* mcspi2 */ 608 - static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = { 609 - .num_chipselect = 2, 610 - }; 611 - 612 660 struct omap_hwmod omap2xxx_mcspi2_hwmod = { 613 661 .name = "mcspi2", 614 662 .main_clk = "mcspi2_fck", ··· 615 673 }, 616 674 }, 617 675 .class = &omap2xxx_mcspi_class, 618 - .dev_attr = &omap_mcspi2_dev_attr, 619 676 }; 620 677 621 678 static struct omap_hwmod_class omap2xxx_counter_hwmod_class = {
-3
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_common_data.h
··· 139 139 extern struct omap_hwmod_class am33xx_ehrpwm_hwmod_class; 140 140 extern struct omap_hwmod_class am33xx_spi_hwmod_class; 141 141 142 - extern struct omap_gpio_dev_attr gpio_dev_attr; 143 - extern struct omap2_mcspi_dev_attr mcspi_attrib; 144 - 145 142 void omap_hwmod_am33xx_reg(void); 146 143 void omap_hwmod_am43xx_reg(void); 147 144
+2 -23
arch/arm/mach-omap2/omap_hwmod_33xx_43xx_ipblock_data.c
··· 14 14 * GNU General Public License for more details. 15 15 */ 16 16 17 - #include <linux/platform_data/gpio-omap.h> 17 + #include <linux/types.h> 18 + 18 19 #include <linux/platform_data/hsmmc-omap.h> 19 - #include <linux/platform_data/spi-omap2-mcspi.h> 20 20 #include "omap_hwmod.h" 21 21 #include "i2c.h" 22 22 #include "wd_timer.h" ··· 537 537 .rev = 2, 538 538 }; 539 539 540 - struct omap_gpio_dev_attr gpio_dev_attr = { 541 - .bank_width = 32, 542 - .dbck_flag = true, 543 - }; 544 - 545 540 /* gpio1 */ 546 541 static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { 547 542 { .role = "dbclk", .clk = "gpio1_dbclk" }, ··· 555 560 }, 556 561 .opt_clks = gpio1_opt_clks, 557 562 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks), 558 - .dev_attr = &gpio_dev_attr, 559 563 }; 560 564 561 565 /* gpio2 */ ··· 575 581 }, 576 582 .opt_clks = gpio2_opt_clks, 577 583 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks), 578 - .dev_attr = &gpio_dev_attr, 579 584 }; 580 585 581 586 /* gpio3 */ ··· 595 602 }, 596 603 .opt_clks = gpio3_opt_clks, 597 604 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks), 598 - .dev_attr = &gpio_dev_attr, 599 605 }; 600 606 601 607 /* gpmc */ ··· 646 654 .reset = &omap_i2c_reset, 647 655 }; 648 656 649 - static struct omap_i2c_dev_attr i2c_dev_attr = { 650 - .flags = OMAP_I2C_FLAG_BUS_SHIFT_NONE, 651 - }; 652 - 653 657 /* i2c1 */ 654 658 struct omap_hwmod am33xx_i2c1_hwmod = { 655 659 .name = "i2c1", ··· 658 670 .modulemode = MODULEMODE_SWCTRL, 659 671 }, 660 672 }, 661 - .dev_attr = &i2c_dev_attr, 662 673 }; 663 674 664 675 /* i2c1 */ ··· 672 685 .modulemode = MODULEMODE_SWCTRL, 673 686 }, 674 687 }, 675 - .dev_attr = &i2c_dev_attr, 676 688 }; 677 689 678 690 /* i2c3 */ ··· 686 700 .modulemode = MODULEMODE_SWCTRL, 687 701 }, 688 702 }, 689 - .dev_attr = &i2c_dev_attr, 690 703 }; 691 704 692 705 /* ··· 878 893 struct omap_hwmod_class am33xx_spi_hwmod_class = { 879 894 .name = "mcspi", 880 895 .sysc = &am33xx_mcspi_sysc, 881 - .rev = OMAP4_MCSPI_REV, 882 896 }; 883 897 884 898 /* spi0 */ 885 - struct omap2_mcspi_dev_attr mcspi_attrib = { 886 - .num_chipselect = 2, 887 - }; 888 899 struct omap_hwmod am33xx_spi0_hwmod = { 889 900 .name = "spi0", 890 901 .class = &am33xx_spi_hwmod_class, ··· 891 910 .modulemode = MODULEMODE_SWCTRL, 892 911 }, 893 912 }, 894 - .dev_attr = &mcspi_attrib, 895 913 }; 896 914 897 915 /* spi1 */ ··· 904 924 .modulemode = MODULEMODE_SWCTRL, 905 925 }, 906 926 }, 907 - .dev_attr = &mcspi_attrib, 908 927 }; 909 928 910 929 /*
-4
arch/arm/mach-omap2/omap_hwmod_33xx_data.c
··· 17 17 #include <linux/i2c-omap.h> 18 18 19 19 #include "omap_hwmod.h" 20 - #include <linux/platform_data/gpio-omap.h> 21 - #include <linux/platform_data/spi-omap2-mcspi.h> 22 - 23 20 #include "omap_hwmod_common_data.h" 24 21 25 22 #include "control.h" ··· 249 252 }, 250 253 .opt_clks = gpio0_opt_clks, 251 254 .opt_clks_cnt = ARRAY_SIZE(gpio0_opt_clks), 252 - .dev_attr = &gpio_dev_attr, 253 255 }; 254 256 255 257 /* lcdc */
-116
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
··· 17 17 18 18 #include <linux/i2c-omap.h> 19 19 #include <linux/power/smartreflex.h> 20 - #include <linux/platform_data/gpio-omap.h> 21 20 #include <linux/platform_data/hsmmc-omap.h> 22 21 23 22 #include <linux/omap-dma.h> 24 23 #include "l3_3xxx.h" 25 24 #include "l4_3xxx.h" 26 - #include <linux/platform_data/asoc-ti-mcbsp.h> 27 - #include <linux/platform_data/spi-omap2-mcspi.h> 28 - #include <plat/dmtimer.h> 29 25 30 26 #include "soc.h" 31 27 #include "omap_hwmod.h" ··· 151 155 .sysc = &omap3xxx_timer_sysc, 152 156 }; 153 157 154 - /* secure timers dev attribute */ 155 - static struct omap_timer_capability_dev_attr capability_secure_dev_attr = { 156 - .timer_capability = OMAP_TIMER_ALWON | OMAP_TIMER_SECURE, 157 - }; 158 - 159 - /* always-on timers dev attribute */ 160 - static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = { 161 - .timer_capability = OMAP_TIMER_ALWON, 162 - }; 163 - 164 - /* pwm timers dev attribute */ 165 - static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = { 166 - .timer_capability = OMAP_TIMER_HAS_PWM, 167 - }; 168 - 169 - /* timers with DSP interrupt dev attribute */ 170 - static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = { 171 - .timer_capability = OMAP_TIMER_HAS_DSP_IRQ, 172 - }; 173 - 174 - /* pwm timers with DSP interrupt dev attribute */ 175 - static struct omap_timer_capability_dev_attr capability_dsp_pwm_dev_attr = { 176 - .timer_capability = OMAP_TIMER_HAS_DSP_IRQ | OMAP_TIMER_HAS_PWM, 177 - }; 178 - 179 158 /* timer1 */ 180 159 static struct omap_hwmod omap3xxx_timer1_hwmod = { 181 160 .name = "timer1", ··· 162 191 .idlest_idle_bit = OMAP3430_ST_GPT1_SHIFT, 163 192 }, 164 193 }, 165 - .dev_attr = &capability_alwon_dev_attr, 166 194 .class = &omap3xxx_timer_hwmod_class, 167 195 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 168 196 }; ··· 222 252 .idlest_idle_bit = OMAP3430_ST_GPT5_SHIFT, 223 253 }, 224 254 }, 225 - .dev_attr = &capability_dsp_dev_attr, 226 255 .class = &omap3xxx_timer_hwmod_class, 227 256 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 228 257 }; ··· 237 268 .idlest_idle_bit = OMAP3430_ST_GPT6_SHIFT, 238 269 }, 239 270 }, 240 - .dev_attr = &capability_dsp_dev_attr, 241 271 .class = &omap3xxx_timer_hwmod_class, 242 272 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 243 273 }; ··· 252 284 .idlest_idle_bit = OMAP3430_ST_GPT7_SHIFT, 253 285 }, 254 286 }, 255 - .dev_attr = &capability_dsp_dev_attr, 256 287 .class = &omap3xxx_timer_hwmod_class, 257 288 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 258 289 }; ··· 267 300 .idlest_idle_bit = OMAP3430_ST_GPT8_SHIFT, 268 301 }, 269 302 }, 270 - .dev_attr = &capability_dsp_pwm_dev_attr, 271 303 .class = &omap3xxx_timer_hwmod_class, 272 304 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 273 305 }; ··· 282 316 .idlest_idle_bit = OMAP3430_ST_GPT9_SHIFT, 283 317 }, 284 318 }, 285 - .dev_attr = &capability_pwm_dev_attr, 286 319 .class = &omap3xxx_timer_hwmod_class, 287 320 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 288 321 }; ··· 297 332 .idlest_idle_bit = OMAP3430_ST_GPT10_SHIFT, 298 333 }, 299 334 }, 300 - .dev_attr = &capability_pwm_dev_attr, 301 335 .class = &omap3xxx_timer_hwmod_class, 302 336 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 303 337 }; ··· 312 348 .idlest_idle_bit = OMAP3430_ST_GPT11_SHIFT, 313 349 }, 314 350 }, 315 - .dev_attr = &capability_pwm_dev_attr, 316 351 .class = &omap3xxx_timer_hwmod_class, 317 352 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 318 353 }; 319 354 320 355 /* timer12 */ 321 - 322 356 static struct omap_hwmod omap3xxx_timer12_hwmod = { 323 357 .name = "timer12", 324 358 .main_clk = "gpt12_fck", ··· 327 365 .idlest_idle_bit = OMAP3430_ST_GPT12_SHIFT, 328 366 }, 329 367 }, 330 - .dev_attr = &capability_secure_dev_attr, 331 368 .class = &omap3xxx_timer_hwmod_class, 332 369 .flags = HWMOD_SET_DEFAULT_CLOCKACT, 333 370 }; ··· 644 683 }; 645 684 646 685 /* I2C1 */ 647 - static struct omap_i2c_dev_attr i2c1_dev_attr = { 648 - .fifo_depth = 8, /* bytes */ 649 - .flags = OMAP_I2C_FLAG_BUS_SHIFT_2, 650 - }; 651 - 652 686 static struct omap_hwmod omap3xxx_i2c1_hwmod = { 653 687 .name = "i2c1", 654 688 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, ··· 656 700 }, 657 701 }, 658 702 .class = &i2c_class, 659 - .dev_attr = &i2c1_dev_attr, 660 703 }; 661 704 662 705 /* I2C2 */ 663 - static struct omap_i2c_dev_attr i2c2_dev_attr = { 664 - .fifo_depth = 8, /* bytes */ 665 - .flags = OMAP_I2C_FLAG_BUS_SHIFT_2, 666 - }; 667 - 668 706 static struct omap_hwmod omap3xxx_i2c2_hwmod = { 669 707 .name = "i2c2", 670 708 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, ··· 671 721 }, 672 722 }, 673 723 .class = &i2c_class, 674 - .dev_attr = &i2c2_dev_attr, 675 724 }; 676 725 677 726 /* I2C3 */ 678 - static struct omap_i2c_dev_attr i2c3_dev_attr = { 679 - .fifo_depth = 64, /* bytes */ 680 - .flags = OMAP_I2C_FLAG_BUS_SHIFT_2, 681 - }; 682 - 683 - 684 - 685 727 static struct omap_hwmod omap3xxx_i2c3_hwmod = { 686 728 .name = "i2c3", 687 729 .flags = HWMOD_16BIT_REG | HWMOD_SET_DEFAULT_CLOCKACT, ··· 686 744 }, 687 745 }, 688 746 .class = &i2c_class, 689 - .dev_attr = &i2c3_dev_attr, 690 747 }; 691 748 692 749 /* ··· 710 769 .rev = 1, 711 770 }; 712 771 713 - /* gpio_dev_attr */ 714 - static struct omap_gpio_dev_attr gpio_dev_attr = { 715 - .bank_width = 32, 716 - .dbck_flag = true, 717 - }; 718 - 719 772 /* gpio1 */ 720 773 static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { 721 774 { .role = "dbclk", .clk = "gpio1_dbck", }, ··· 729 794 }, 730 795 }, 731 796 .class = &omap3xxx_gpio_hwmod_class, 732 - .dev_attr = &gpio_dev_attr, 733 797 }; 734 798 735 799 /* gpio2 */ ··· 750 816 }, 751 817 }, 752 818 .class = &omap3xxx_gpio_hwmod_class, 753 - .dev_attr = &gpio_dev_attr, 754 819 }; 755 820 756 821 /* gpio3 */ ··· 771 838 }, 772 839 }, 773 840 .class = &omap3xxx_gpio_hwmod_class, 774 - .dev_attr = &gpio_dev_attr, 775 841 }; 776 842 777 843 /* gpio4 */ ··· 792 860 }, 793 861 }, 794 862 .class = &omap3xxx_gpio_hwmod_class, 795 - .dev_attr = &gpio_dev_attr, 796 863 }; 797 864 798 865 /* gpio5 */ ··· 814 883 }, 815 884 }, 816 885 .class = &omap3xxx_gpio_hwmod_class, 817 - .dev_attr = &gpio_dev_attr, 818 886 }; 819 887 820 888 /* gpio6 */ ··· 836 906 }, 837 907 }, 838 908 .class = &omap3xxx_gpio_hwmod_class, 839 - .dev_attr = &gpio_dev_attr, 840 909 }; 841 910 842 911 /* dma attributes */ ··· 895 966 static struct omap_hwmod_class omap3xxx_mcbsp_hwmod_class = { 896 967 .name = "mcbsp", 897 968 .sysc = &omap3xxx_mcbsp_sysc, 898 - .rev = MCBSP_CONFIG_TYPE3, 899 969 }; 900 970 901 971 /* McBSP functional clock mapping */ ··· 909 981 }; 910 982 911 983 /* mcbsp1 */ 912 - 913 984 static struct omap_hwmod omap3xxx_mcbsp1_hwmod = { 914 985 .name = "mcbsp1", 915 986 .class = &omap3xxx_mcbsp_hwmod_class, ··· 925 998 }; 926 999 927 1000 /* mcbsp2 */ 928 - 929 - static struct omap_mcbsp_dev_attr omap34xx_mcbsp2_dev_attr = { 930 - .sidetone = "mcbsp2_sidetone", 931 - }; 932 - 933 1001 static struct omap_hwmod omap3xxx_mcbsp2_hwmod = { 934 1002 .name = "mcbsp2", 935 1003 .class = &omap3xxx_mcbsp_hwmod_class, ··· 938 1016 }, 939 1017 .opt_clks = mcbsp234_opt_clks, 940 1018 .opt_clks_cnt = ARRAY_SIZE(mcbsp234_opt_clks), 941 - .dev_attr = &omap34xx_mcbsp2_dev_attr, 942 1019 }; 943 1020 944 1021 /* mcbsp3 */ 945 - 946 - static struct omap_mcbsp_dev_attr omap34xx_mcbsp3_dev_attr = { 947 - .sidetone = "mcbsp3_sidetone", 948 - }; 949 - 950 1022 static struct omap_hwmod omap3xxx_mcbsp3_hwmod = { 951 1023 .name = "mcbsp3", 952 1024 .class = &omap3xxx_mcbsp_hwmod_class, ··· 954 1038 }, 955 1039 .opt_clks = mcbsp234_opt_clks, 956 1040 .opt_clks_cnt = ARRAY_SIZE(mcbsp234_opt_clks), 957 - .dev_attr = &omap34xx_mcbsp3_dev_attr, 958 1041 }; 959 1042 960 1043 /* mcbsp4 */ 961 - 962 - 963 1044 static struct omap_hwmod omap3xxx_mcbsp4_hwmod = { 964 1045 .name = "mcbsp4", 965 1046 .class = &omap3xxx_mcbsp_hwmod_class, ··· 973 1060 }; 974 1061 975 1062 /* mcbsp5 */ 976 - 977 - 978 1063 static struct omap_hwmod omap3xxx_mcbsp5_hwmod = { 979 1064 .name = "mcbsp5", 980 1065 .class = &omap3xxx_mcbsp_hwmod_class, ··· 1001 1090 }; 1002 1091 1003 1092 /* mcbsp2_sidetone */ 1004 - 1005 1093 static struct omap_hwmod omap3xxx_mcbsp2_sidetone_hwmod = { 1006 1094 .name = "mcbsp2_sidetone", 1007 1095 .class = &omap3xxx_mcbsp_sidetone_hwmod_class, ··· 1009 1099 }; 1010 1100 1011 1101 /* mcbsp3_sidetone */ 1012 - 1013 1102 static struct omap_hwmod omap3xxx_mcbsp3_sidetone_hwmod = { 1014 1103 .name = "mcbsp3_sidetone", 1015 1104 .class = &omap3xxx_mcbsp_sidetone_hwmod_class, ··· 1167 1258 static struct omap_hwmod_class omap34xx_mcspi_class = { 1168 1259 .name = "mcspi", 1169 1260 .sysc = &omap34xx_mcspi_sysc, 1170 - .rev = OMAP3_MCSPI_REV, 1171 1261 }; 1172 1262 1173 1263 /* mcspi1 */ 1174 - static struct omap2_mcspi_dev_attr omap_mcspi1_dev_attr = { 1175 - .num_chipselect = 4, 1176 - }; 1177 - 1178 1264 static struct omap_hwmod omap34xx_mcspi1 = { 1179 1265 .name = "mcspi1", 1180 1266 .main_clk = "mcspi1_fck", ··· 1181 1277 }, 1182 1278 }, 1183 1279 .class = &omap34xx_mcspi_class, 1184 - .dev_attr = &omap_mcspi1_dev_attr, 1185 1280 }; 1186 1281 1187 1282 /* mcspi2 */ 1188 - static struct omap2_mcspi_dev_attr omap_mcspi2_dev_attr = { 1189 - .num_chipselect = 2, 1190 - }; 1191 - 1192 1283 static struct omap_hwmod omap34xx_mcspi2 = { 1193 1284 .name = "mcspi2", 1194 1285 .main_clk = "mcspi2_fck", ··· 1195 1296 }, 1196 1297 }, 1197 1298 .class = &omap34xx_mcspi_class, 1198 - .dev_attr = &omap_mcspi2_dev_attr, 1199 1299 }; 1200 1300 1201 1301 /* mcspi3 */ 1202 - 1203 - 1204 - static struct omap2_mcspi_dev_attr omap_mcspi3_dev_attr = { 1205 - .num_chipselect = 2, 1206 - }; 1207 - 1208 1302 static struct omap_hwmod omap34xx_mcspi3 = { 1209 1303 .name = "mcspi3", 1210 1304 .main_clk = "mcspi3_fck", ··· 1209 1317 }, 1210 1318 }, 1211 1319 .class = &omap34xx_mcspi_class, 1212 - .dev_attr = &omap_mcspi3_dev_attr, 1213 1320 }; 1214 1321 1215 1322 /* mcspi4 */ 1216 - 1217 - 1218 - static struct omap2_mcspi_dev_attr omap_mcspi4_dev_attr = { 1219 - .num_chipselect = 1, 1220 - }; 1221 - 1222 1323 static struct omap_hwmod omap34xx_mcspi4 = { 1223 1324 .name = "mcspi4", 1224 1325 .main_clk = "mcspi4_fck", ··· 1223 1338 }, 1224 1339 }, 1225 1340 .class = &omap34xx_mcspi_class, 1226 - .dev_attr = &omap_mcspi4_dev_attr, 1227 1341 }; 1228 1342 1229 1343 /* usbhsotg */
-8
arch/arm/mach-omap2/omap_hwmod_43xx_data.c
··· 14 14 * GNU General Public License for more details. 15 15 */ 16 16 17 - #include <linux/platform_data/gpio-omap.h> 18 - #include <linux/platform_data/spi-omap2-mcspi.h> 19 17 #include "omap_hwmod.h" 20 18 #include "omap_hwmod_33xx_43xx_common_data.h" 21 19 #include "prcm43xx.h" ··· 105 107 }, 106 108 .opt_clks = gpio0_opt_clks, 107 109 .opt_clks_cnt = ARRAY_SIZE(gpio0_opt_clks), 108 - .dev_attr = &gpio_dev_attr, 109 110 }; 110 111 111 112 static struct omap_hwmod_class_sysconfig am43xx_synctimer_sysc = { ··· 236 239 .modulemode = MODULEMODE_SWCTRL, 237 240 }, 238 241 }, 239 - .dev_attr = &mcspi_attrib, 240 242 }; 241 243 242 244 static struct omap_hwmod am43xx_spi3_hwmod = { ··· 249 253 .modulemode = MODULEMODE_SWCTRL, 250 254 }, 251 255 }, 252 - .dev_attr = &mcspi_attrib, 253 256 }; 254 257 255 258 static struct omap_hwmod am43xx_spi4_hwmod = { ··· 262 267 .modulemode = MODULEMODE_SWCTRL, 263 268 }, 264 269 }, 265 - .dev_attr = &mcspi_attrib, 266 270 }; 267 271 268 272 static struct omap_hwmod_opt_clk gpio4_opt_clks[] = { ··· 282 288 }, 283 289 .opt_clks = gpio4_opt_clks, 284 290 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks), 285 - .dev_attr = &gpio_dev_attr, 286 291 }; 287 292 288 293 static struct omap_hwmod_opt_clk gpio5_opt_clks[] = { ··· 302 309 }, 303 310 .opt_clks = gpio5_opt_clks, 304 311 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks), 305 - .dev_attr = &gpio_dev_attr, 306 312 }; 307 313 308 314 static struct omap_hwmod_class am43xx_ocp2scp_hwmod_class = {
-75
arch/arm/mach-omap2/omap_hwmod_44xx_data.c
··· 21 21 */ 22 22 23 23 #include <linux/io.h> 24 - #include <linux/platform_data/gpio-omap.h> 25 24 #include <linux/platform_data/hsmmc-omap.h> 26 25 #include <linux/power/smartreflex.h> 27 26 #include <linux/i2c-omap.h> 28 27 29 28 #include <linux/omap-dma.h> 30 - 31 - #include <linux/platform_data/spi-omap2-mcspi.h> 32 - #include <linux/platform_data/asoc-ti-mcbsp.h> 33 - #include <plat/dmtimer.h> 34 29 35 30 #include "omap_hwmod.h" 36 31 #include "omap_hwmod_common_data.h" ··· 1078 1083 .rev = 2, 1079 1084 }; 1080 1085 1081 - /* gpio dev_attr */ 1082 - static struct omap_gpio_dev_attr gpio_dev_attr = { 1083 - .bank_width = 32, 1084 - .dbck_flag = true, 1085 - }; 1086 - 1087 1086 /* gpio1 */ 1088 1087 static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { 1089 1088 { .role = "dbclk", .clk = "gpio1_dbclk" }, ··· 1097 1108 }, 1098 1109 .opt_clks = gpio1_opt_clks, 1099 1110 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks), 1100 - .dev_attr = &gpio_dev_attr, 1101 1111 }; 1102 1112 1103 1113 /* gpio2 */ ··· 1119 1131 }, 1120 1132 .opt_clks = gpio2_opt_clks, 1121 1133 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks), 1122 - .dev_attr = &gpio_dev_attr, 1123 1134 }; 1124 1135 1125 1136 /* gpio3 */ ··· 1141 1154 }, 1142 1155 .opt_clks = gpio3_opt_clks, 1143 1156 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks), 1144 - .dev_attr = &gpio_dev_attr, 1145 1157 }; 1146 1158 1147 1159 /* gpio4 */ ··· 1163 1177 }, 1164 1178 .opt_clks = gpio4_opt_clks, 1165 1179 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks), 1166 - .dev_attr = &gpio_dev_attr, 1167 1180 }; 1168 1181 1169 1182 /* gpio5 */ ··· 1185 1200 }, 1186 1201 .opt_clks = gpio5_opt_clks, 1187 1202 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks), 1188 - .dev_attr = &gpio_dev_attr, 1189 1203 }; 1190 1204 1191 1205 /* gpio6 */ ··· 1207 1223 }, 1208 1224 .opt_clks = gpio6_opt_clks, 1209 1225 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks), 1210 - .dev_attr = &gpio_dev_attr, 1211 1226 }; 1212 1227 1213 1228 /* ··· 1377 1394 .reset = &omap_i2c_reset, 1378 1395 }; 1379 1396 1380 - static struct omap_i2c_dev_attr i2c_dev_attr = { 1381 - .flags = OMAP_I2C_FLAG_BUS_SHIFT_NONE, 1382 - }; 1383 - 1384 1397 /* i2c1 */ 1385 1398 static struct omap_hwmod omap44xx_i2c1_hwmod = { 1386 1399 .name = "i2c1", ··· 1391 1412 .modulemode = MODULEMODE_SWCTRL, 1392 1413 }, 1393 1414 }, 1394 - .dev_attr = &i2c_dev_attr, 1395 1415 }; 1396 1416 1397 1417 /* i2c2 */ ··· 1407 1429 .modulemode = MODULEMODE_SWCTRL, 1408 1430 }, 1409 1431 }, 1410 - .dev_attr = &i2c_dev_attr, 1411 1432 }; 1412 1433 1413 1434 /* i2c3 */ ··· 1423 1446 .modulemode = MODULEMODE_SWCTRL, 1424 1447 }, 1425 1448 }, 1426 - .dev_attr = &i2c_dev_attr, 1427 1449 }; 1428 1450 1429 1451 /* i2c4 */ ··· 1439 1463 .modulemode = MODULEMODE_SWCTRL, 1440 1464 }, 1441 1465 }, 1442 - .dev_attr = &i2c_dev_attr, 1443 1466 }; 1444 1467 1445 1468 /* ··· 1677 1702 static struct omap_hwmod_class omap44xx_mcbsp_hwmod_class = { 1678 1703 .name = "mcbsp", 1679 1704 .sysc = &omap44xx_mcbsp_sysc, 1680 - .rev = MCBSP_CONFIG_TYPE4, 1681 1705 }; 1682 1706 1683 1707 /* mcbsp1 */ ··· 1834 1860 static struct omap_hwmod_class omap44xx_mcspi_hwmod_class = { 1835 1861 .name = "mcspi", 1836 1862 .sysc = &omap44xx_mcspi_sysc, 1837 - .rev = OMAP4_MCSPI_REV, 1838 1863 }; 1839 1864 1840 1865 /* mcspi1 */ 1841 - static struct omap2_mcspi_dev_attr mcspi1_dev_attr = { 1842 - .num_chipselect = 4, 1843 - }; 1844 - 1845 1866 static struct omap_hwmod omap44xx_mcspi1_hwmod = { 1846 1867 .name = "mcspi1", 1847 1868 .class = &omap44xx_mcspi_hwmod_class, ··· 1849 1880 .modulemode = MODULEMODE_SWCTRL, 1850 1881 }, 1851 1882 }, 1852 - .dev_attr = &mcspi1_dev_attr, 1853 1883 }; 1854 1884 1855 1885 /* mcspi2 */ 1856 - static struct omap2_mcspi_dev_attr mcspi2_dev_attr = { 1857 - .num_chipselect = 2, 1858 - }; 1859 - 1860 1886 static struct omap_hwmod omap44xx_mcspi2_hwmod = { 1861 1887 .name = "mcspi2", 1862 1888 .class = &omap44xx_mcspi_hwmod_class, ··· 1864 1900 .modulemode = MODULEMODE_SWCTRL, 1865 1901 }, 1866 1902 }, 1867 - .dev_attr = &mcspi2_dev_attr, 1868 1903 }; 1869 1904 1870 1905 /* mcspi3 */ 1871 - static struct omap2_mcspi_dev_attr mcspi3_dev_attr = { 1872 - .num_chipselect = 2, 1873 - }; 1874 - 1875 1906 static struct omap_hwmod omap44xx_mcspi3_hwmod = { 1876 1907 .name = "mcspi3", 1877 1908 .class = &omap44xx_mcspi_hwmod_class, ··· 1879 1920 .modulemode = MODULEMODE_SWCTRL, 1880 1921 }, 1881 1922 }, 1882 - .dev_attr = &mcspi3_dev_attr, 1883 1923 }; 1884 1924 1885 1925 /* mcspi4 */ 1886 - static struct omap2_mcspi_dev_attr mcspi4_dev_attr = { 1887 - .num_chipselect = 1, 1888 - }; 1889 - 1890 1926 static struct omap_hwmod omap44xx_mcspi4_hwmod = { 1891 1927 .name = "mcspi4", 1892 1928 .class = &omap44xx_mcspi_hwmod_class, ··· 1894 1940 .modulemode = MODULEMODE_SWCTRL, 1895 1941 }, 1896 1942 }, 1897 - .dev_attr = &mcspi4_dev_attr, 1898 1943 }; 1899 1944 1900 1945 /* ··· 2500 2547 .sysc = &omap44xx_timer_sysc, 2501 2548 }; 2502 2549 2503 - /* always-on timers dev attribute */ 2504 - static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = { 2505 - .timer_capability = OMAP_TIMER_ALWON, 2506 - }; 2507 - 2508 - /* pwm timers dev attribute */ 2509 - static struct omap_timer_capability_dev_attr capability_pwm_dev_attr = { 2510 - .timer_capability = OMAP_TIMER_HAS_PWM, 2511 - }; 2512 - 2513 - /* timers with DSP interrupt dev attribute */ 2514 - static struct omap_timer_capability_dev_attr capability_dsp_dev_attr = { 2515 - .timer_capability = OMAP_TIMER_HAS_DSP_IRQ, 2516 - }; 2517 - 2518 - /* pwm timers with DSP interrupt dev attribute */ 2519 - static struct omap_timer_capability_dev_attr capability_dsp_pwm_dev_attr = { 2520 - .timer_capability = OMAP_TIMER_HAS_DSP_IRQ | OMAP_TIMER_HAS_PWM, 2521 - }; 2522 - 2523 2550 /* timer1 */ 2524 2551 static struct omap_hwmod omap44xx_timer1_hwmod = { 2525 2552 .name = "timer1", ··· 2514 2581 .modulemode = MODULEMODE_SWCTRL, 2515 2582 }, 2516 2583 }, 2517 - .dev_attr = &capability_alwon_dev_attr, 2518 2584 }; 2519 2585 2520 2586 /* timer2 */ ··· 2575 2643 .modulemode = MODULEMODE_SWCTRL, 2576 2644 }, 2577 2645 }, 2578 - .dev_attr = &capability_dsp_dev_attr, 2579 2646 }; 2580 2647 2581 2648 /* timer6 */ ··· 2590 2659 .modulemode = MODULEMODE_SWCTRL, 2591 2660 }, 2592 2661 }, 2593 - .dev_attr = &capability_dsp_dev_attr, 2594 2662 }; 2595 2663 2596 2664 /* timer7 */ ··· 2605 2675 .modulemode = MODULEMODE_SWCTRL, 2606 2676 }, 2607 2677 }, 2608 - .dev_attr = &capability_dsp_dev_attr, 2609 2678 }; 2610 2679 2611 2680 /* timer8 */ ··· 2620 2691 .modulemode = MODULEMODE_SWCTRL, 2621 2692 }, 2622 2693 }, 2623 - .dev_attr = &capability_dsp_pwm_dev_attr, 2624 2694 }; 2625 2695 2626 2696 /* timer9 */ ··· 2635 2707 .modulemode = MODULEMODE_SWCTRL, 2636 2708 }, 2637 2709 }, 2638 - .dev_attr = &capability_pwm_dev_attr, 2639 2710 }; 2640 2711 2641 2712 /* timer10 */ ··· 2651 2724 .modulemode = MODULEMODE_SWCTRL, 2652 2725 }, 2653 2726 }, 2654 - .dev_attr = &capability_pwm_dev_attr, 2655 2727 }; 2656 2728 2657 2729 /* timer11 */ ··· 2666 2740 .modulemode = MODULEMODE_SWCTRL, 2667 2741 }, 2668 2742 }, 2669 - .dev_attr = &capability_pwm_dev_attr, 2670 2743 }; 2671 2744 2672 2745 /*
-54
arch/arm/mach-omap2/omap_hwmod_54xx_data.c
··· 18 18 */ 19 19 20 20 #include <linux/io.h> 21 - #include <linux/platform_data/gpio-omap.h> 22 21 #include <linux/platform_data/hsmmc-omap.h> 23 22 #include <linux/power/smartreflex.h> 24 23 #include <linux/i2c-omap.h> 25 24 26 25 #include <linux/omap-dma.h> 27 - #include <linux/platform_data/spi-omap2-mcspi.h> 28 - #include <linux/platform_data/asoc-ti-mcbsp.h> 29 - #include <plat/dmtimer.h> 30 26 31 27 #include "omap_hwmod.h" 32 28 #include "omap_hwmod_common_data.h" ··· 623 627 .rev = 2, 624 628 }; 625 629 626 - /* gpio dev_attr */ 627 - static struct omap_gpio_dev_attr gpio_dev_attr = { 628 - .bank_width = 32, 629 - .dbck_flag = true, 630 - }; 631 - 632 630 /* gpio1 */ 633 631 static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { 634 632 { .role = "dbclk", .clk = "gpio1_dbclk" }, ··· 642 652 }, 643 653 .opt_clks = gpio1_opt_clks, 644 654 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks), 645 - .dev_attr = &gpio_dev_attr, 646 655 }; 647 656 648 657 /* gpio2 */ ··· 664 675 }, 665 676 .opt_clks = gpio2_opt_clks, 666 677 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks), 667 - .dev_attr = &gpio_dev_attr, 668 678 }; 669 679 670 680 /* gpio3 */ ··· 686 698 }, 687 699 .opt_clks = gpio3_opt_clks, 688 700 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks), 689 - .dev_attr = &gpio_dev_attr, 690 701 }; 691 702 692 703 /* gpio4 */ ··· 708 721 }, 709 722 .opt_clks = gpio4_opt_clks, 710 723 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks), 711 - .dev_attr = &gpio_dev_attr, 712 724 }; 713 725 714 726 /* gpio5 */ ··· 730 744 }, 731 745 .opt_clks = gpio5_opt_clks, 732 746 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks), 733 - .dev_attr = &gpio_dev_attr, 734 747 }; 735 748 736 749 /* gpio6 */ ··· 752 767 }, 753 768 .opt_clks = gpio6_opt_clks, 754 769 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks), 755 - .dev_attr = &gpio_dev_attr, 756 770 }; 757 771 758 772 /* gpio7 */ ··· 774 790 }, 775 791 .opt_clks = gpio7_opt_clks, 776 792 .opt_clks_cnt = ARRAY_SIZE(gpio7_opt_clks), 777 - .dev_attr = &gpio_dev_attr, 778 793 }; 779 794 780 795 /* gpio8 */ ··· 796 813 }, 797 814 .opt_clks = gpio8_opt_clks, 798 815 .opt_clks_cnt = ARRAY_SIZE(gpio8_opt_clks), 799 - .dev_attr = &gpio_dev_attr, 800 816 }; 801 817 802 818 /* ··· 821 839 .rev = OMAP_I2C_IP_VERSION_2, 822 840 }; 823 841 824 - /* i2c dev_attr */ 825 - static struct omap_i2c_dev_attr i2c_dev_attr = { 826 - .flags = OMAP_I2C_FLAG_BUS_SHIFT_NONE, 827 - }; 828 - 829 842 /* i2c1 */ 830 843 static struct omap_hwmod omap54xx_i2c1_hwmod = { 831 844 .name = "i2c1", ··· 835 858 .modulemode = MODULEMODE_SWCTRL, 836 859 }, 837 860 }, 838 - .dev_attr = &i2c_dev_attr, 839 861 }; 840 862 841 863 /* i2c2 */ ··· 851 875 .modulemode = MODULEMODE_SWCTRL, 852 876 }, 853 877 }, 854 - .dev_attr = &i2c_dev_attr, 855 878 }; 856 879 857 880 /* i2c3 */ ··· 867 892 .modulemode = MODULEMODE_SWCTRL, 868 893 }, 869 894 }, 870 - .dev_attr = &i2c_dev_attr, 871 895 }; 872 896 873 897 /* i2c4 */ ··· 883 909 .modulemode = MODULEMODE_SWCTRL, 884 910 }, 885 911 }, 886 - .dev_attr = &i2c_dev_attr, 887 912 }; 888 913 889 914 /* i2c5 */ ··· 899 926 .modulemode = MODULEMODE_SWCTRL, 900 927 }, 901 928 }, 902 - .dev_attr = &i2c_dev_attr, 903 929 }; 904 930 905 931 /* ··· 984 1012 static struct omap_hwmod_class omap54xx_mcbsp_hwmod_class = { 985 1013 .name = "mcbsp", 986 1014 .sysc = &omap54xx_mcbsp_sysc, 987 - .rev = MCBSP_CONFIG_TYPE4, 988 1015 }; 989 1016 990 1017 /* mcbsp1 */ ··· 1120 1149 static struct omap_hwmod_class omap54xx_mcspi_hwmod_class = { 1121 1150 .name = "mcspi", 1122 1151 .sysc = &omap54xx_mcspi_sysc, 1123 - .rev = OMAP4_MCSPI_REV, 1124 1152 }; 1125 1153 1126 1154 /* mcspi1 */ 1127 - /* mcspi1 dev_attr */ 1128 - static struct omap2_mcspi_dev_attr mcspi1_dev_attr = { 1129 - .num_chipselect = 4, 1130 - }; 1131 - 1132 1155 static struct omap_hwmod omap54xx_mcspi1_hwmod = { 1133 1156 .name = "mcspi1", 1134 1157 .class = &omap54xx_mcspi_hwmod_class, ··· 1135 1170 .modulemode = MODULEMODE_SWCTRL, 1136 1171 }, 1137 1172 }, 1138 - .dev_attr = &mcspi1_dev_attr, 1139 1173 }; 1140 1174 1141 1175 /* mcspi2 */ 1142 - /* mcspi2 dev_attr */ 1143 - static struct omap2_mcspi_dev_attr mcspi2_dev_attr = { 1144 - .num_chipselect = 2, 1145 - }; 1146 - 1147 1176 static struct omap_hwmod omap54xx_mcspi2_hwmod = { 1148 1177 .name = "mcspi2", 1149 1178 .class = &omap54xx_mcspi_hwmod_class, ··· 1150 1191 .modulemode = MODULEMODE_SWCTRL, 1151 1192 }, 1152 1193 }, 1153 - .dev_attr = &mcspi2_dev_attr, 1154 1194 }; 1155 1195 1156 1196 /* mcspi3 */ 1157 - /* mcspi3 dev_attr */ 1158 - static struct omap2_mcspi_dev_attr mcspi3_dev_attr = { 1159 - .num_chipselect = 2, 1160 - }; 1161 - 1162 1197 static struct omap_hwmod omap54xx_mcspi3_hwmod = { 1163 1198 .name = "mcspi3", 1164 1199 .class = &omap54xx_mcspi_hwmod_class, ··· 1165 1212 .modulemode = MODULEMODE_SWCTRL, 1166 1213 }, 1167 1214 }, 1168 - .dev_attr = &mcspi3_dev_attr, 1169 1215 }; 1170 1216 1171 1217 /* mcspi4 */ 1172 - /* mcspi4 dev_attr */ 1173 - static struct omap2_mcspi_dev_attr mcspi4_dev_attr = { 1174 - .num_chipselect = 1, 1175 - }; 1176 - 1177 1218 static struct omap_hwmod omap54xx_mcspi4_hwmod = { 1178 1219 .name = "mcspi4", 1179 1220 .class = &omap54xx_mcspi_hwmod_class, ··· 1180 1233 .modulemode = MODULEMODE_SWCTRL, 1181 1234 }, 1182 1235 }, 1183 - .dev_attr = &mcspi4_dev_attr, 1184 1236 }; 1185 1237 1186 1238 /*
-53
arch/arm/mach-omap2/omap_hwmod_7xx_data.c
··· 18 18 */ 19 19 20 20 #include <linux/io.h> 21 - #include <linux/platform_data/gpio-omap.h> 22 21 #include <linux/platform_data/hsmmc-omap.h> 23 22 #include <linux/power/smartreflex.h> 24 23 #include <linux/i2c-omap.h> 25 24 26 25 #include <linux/omap-dma.h> 27 - #include <linux/platform_data/spi-omap2-mcspi.h> 28 - #include <linux/platform_data/asoc-ti-mcbsp.h> 29 - #include <plat/dmtimer.h> 30 26 31 27 #include "omap_hwmod.h" 32 28 #include "omap_hwmod_common_data.h" ··· 814 818 .rev = 2, 815 819 }; 816 820 817 - /* gpio dev_attr */ 818 - static struct omap_gpio_dev_attr gpio_dev_attr = { 819 - .bank_width = 32, 820 - .dbck_flag = true, 821 - }; 822 - 823 821 /* gpio1 */ 824 822 static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { 825 823 { .role = "dbclk", .clk = "gpio1_dbclk" }, ··· 834 844 }, 835 845 .opt_clks = gpio1_opt_clks, 836 846 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks), 837 - .dev_attr = &gpio_dev_attr, 838 847 }; 839 848 840 849 /* gpio2 */ ··· 856 867 }, 857 868 .opt_clks = gpio2_opt_clks, 858 869 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks), 859 - .dev_attr = &gpio_dev_attr, 860 870 }; 861 871 862 872 /* gpio3 */ ··· 878 890 }, 879 891 .opt_clks = gpio3_opt_clks, 880 892 .opt_clks_cnt = ARRAY_SIZE(gpio3_opt_clks), 881 - .dev_attr = &gpio_dev_attr, 882 893 }; 883 894 884 895 /* gpio4 */ ··· 900 913 }, 901 914 .opt_clks = gpio4_opt_clks, 902 915 .opt_clks_cnt = ARRAY_SIZE(gpio4_opt_clks), 903 - .dev_attr = &gpio_dev_attr, 904 916 }; 905 917 906 918 /* gpio5 */ ··· 922 936 }, 923 937 .opt_clks = gpio5_opt_clks, 924 938 .opt_clks_cnt = ARRAY_SIZE(gpio5_opt_clks), 925 - .dev_attr = &gpio_dev_attr, 926 939 }; 927 940 928 941 /* gpio6 */ ··· 944 959 }, 945 960 .opt_clks = gpio6_opt_clks, 946 961 .opt_clks_cnt = ARRAY_SIZE(gpio6_opt_clks), 947 - .dev_attr = &gpio_dev_attr, 948 962 }; 949 963 950 964 /* gpio7 */ ··· 966 982 }, 967 983 .opt_clks = gpio7_opt_clks, 968 984 .opt_clks_cnt = ARRAY_SIZE(gpio7_opt_clks), 969 - .dev_attr = &gpio_dev_attr, 970 985 }; 971 986 972 987 /* gpio8 */ ··· 988 1005 }, 989 1006 .opt_clks = gpio8_opt_clks, 990 1007 .opt_clks_cnt = ARRAY_SIZE(gpio8_opt_clks), 991 - .dev_attr = &gpio_dev_attr, 992 1008 }; 993 1009 994 1010 /* ··· 1087 1105 .rev = OMAP_I2C_IP_VERSION_2, 1088 1106 }; 1089 1107 1090 - /* i2c dev_attr */ 1091 - static struct omap_i2c_dev_attr i2c_dev_attr = { 1092 - .flags = OMAP_I2C_FLAG_BUS_SHIFT_NONE, 1093 - }; 1094 - 1095 1108 /* i2c1 */ 1096 1109 static struct omap_hwmod dra7xx_i2c1_hwmod = { 1097 1110 .name = "i2c1", ··· 1101 1124 .modulemode = MODULEMODE_SWCTRL, 1102 1125 }, 1103 1126 }, 1104 - .dev_attr = &i2c_dev_attr, 1105 1127 }; 1106 1128 1107 1129 /* i2c2 */ ··· 1117 1141 .modulemode = MODULEMODE_SWCTRL, 1118 1142 }, 1119 1143 }, 1120 - .dev_attr = &i2c_dev_attr, 1121 1144 }; 1122 1145 1123 1146 /* i2c3 */ ··· 1133 1158 .modulemode = MODULEMODE_SWCTRL, 1134 1159 }, 1135 1160 }, 1136 - .dev_attr = &i2c_dev_attr, 1137 1161 }; 1138 1162 1139 1163 /* i2c4 */ ··· 1149 1175 .modulemode = MODULEMODE_SWCTRL, 1150 1176 }, 1151 1177 }, 1152 - .dev_attr = &i2c_dev_attr, 1153 1178 }; 1154 1179 1155 1180 /* i2c5 */ ··· 1165 1192 .modulemode = MODULEMODE_SWCTRL, 1166 1193 }, 1167 1194 }, 1168 - .dev_attr = &i2c_dev_attr, 1169 1195 }; 1170 1196 1171 1197 /* ··· 1373 1401 static struct omap_hwmod_class dra7xx_mcspi_hwmod_class = { 1374 1402 .name = "mcspi", 1375 1403 .sysc = &dra7xx_mcspi_sysc, 1376 - .rev = OMAP4_MCSPI_REV, 1377 1404 }; 1378 1405 1379 1406 /* mcspi1 */ 1380 - /* mcspi1 dev_attr */ 1381 - static struct omap2_mcspi_dev_attr mcspi1_dev_attr = { 1382 - .num_chipselect = 4, 1383 - }; 1384 - 1385 1407 static struct omap_hwmod dra7xx_mcspi1_hwmod = { 1386 1408 .name = "mcspi1", 1387 1409 .class = &dra7xx_mcspi_hwmod_class, ··· 1388 1422 .modulemode = MODULEMODE_SWCTRL, 1389 1423 }, 1390 1424 }, 1391 - .dev_attr = &mcspi1_dev_attr, 1392 1425 }; 1393 1426 1394 1427 /* mcspi2 */ 1395 - /* mcspi2 dev_attr */ 1396 - static struct omap2_mcspi_dev_attr mcspi2_dev_attr = { 1397 - .num_chipselect = 2, 1398 - }; 1399 - 1400 1428 static struct omap_hwmod dra7xx_mcspi2_hwmod = { 1401 1429 .name = "mcspi2", 1402 1430 .class = &dra7xx_mcspi_hwmod_class, ··· 1403 1443 .modulemode = MODULEMODE_SWCTRL, 1404 1444 }, 1405 1445 }, 1406 - .dev_attr = &mcspi2_dev_attr, 1407 1446 }; 1408 1447 1409 1448 /* mcspi3 */ 1410 - /* mcspi3 dev_attr */ 1411 - static struct omap2_mcspi_dev_attr mcspi3_dev_attr = { 1412 - .num_chipselect = 2, 1413 - }; 1414 - 1415 1449 static struct omap_hwmod dra7xx_mcspi3_hwmod = { 1416 1450 .name = "mcspi3", 1417 1451 .class = &dra7xx_mcspi_hwmod_class, ··· 1418 1464 .modulemode = MODULEMODE_SWCTRL, 1419 1465 }, 1420 1466 }, 1421 - .dev_attr = &mcspi3_dev_attr, 1422 1467 }; 1423 1468 1424 1469 /* mcspi4 */ 1425 - /* mcspi4 dev_attr */ 1426 - static struct omap2_mcspi_dev_attr mcspi4_dev_attr = { 1427 - .num_chipselect = 1, 1428 - }; 1429 - 1430 1470 static struct omap_hwmod dra7xx_mcspi4_hwmod = { 1431 1471 .name = "mcspi4", 1432 1472 .class = &dra7xx_mcspi_hwmod_class, ··· 1433 1485 .modulemode = MODULEMODE_SWCTRL, 1434 1486 }, 1435 1487 }, 1436 - .dev_attr = &mcspi4_dev_attr, 1437 1488 }; 1438 1489 1439 1490 /*
+2 -29
arch/arm/mach-omap2/omap_hwmod_81xx_data.c
··· 15 15 * 16 16 */ 17 17 18 - #include <linux/platform_data/gpio-omap.h> 18 + #include <linux/types.h> 19 + 19 20 #include <linux/platform_data/hsmmc-omap.h> 20 - #include <linux/platform_data/spi-omap2-mcspi.h> 21 - #include <plat/dmtimer.h> 22 21 23 22 #include "omap_hwmod_common_data.h" 24 23 #include "cm81xx.h" ··· 487 488 .rev = 2, 488 489 }; 489 490 490 - static struct omap_gpio_dev_attr gpio_dev_attr = { 491 - .bank_width = 32, 492 - .dbck_flag = true, 493 - }; 494 - 495 491 static struct omap_hwmod_opt_clk gpio1_opt_clks[] = { 496 492 { .role = "dbclk", .clk = "sysclk18_ck" }, 497 493 }; ··· 504 510 }, 505 511 .opt_clks = gpio1_opt_clks, 506 512 .opt_clks_cnt = ARRAY_SIZE(gpio1_opt_clks), 507 - .dev_attr = &gpio_dev_attr, 508 513 }; 509 514 510 515 static struct omap_hwmod_ocp_if dm81xx_l4_ls__gpio1 = { ··· 530 537 }, 531 538 .opt_clks = gpio2_opt_clks, 532 539 .opt_clks_cnt = ARRAY_SIZE(gpio2_opt_clks), 533 - .dev_attr = &gpio_dev_attr, 534 540 }; 535 541 536 542 static struct omap_hwmod_ocp_if dm81xx_l4_ls__gpio2 = { ··· 646 654 .sysc = &dm816x_timer_sysc, 647 655 }; 648 656 649 - static struct omap_timer_capability_dev_attr capability_alwon_dev_attr = { 650 - .timer_capability = OMAP_TIMER_ALWON, 651 - }; 652 - 653 657 static struct omap_hwmod dm814x_timer1_hwmod = { 654 658 .name = "timer1", 655 659 .clkdm_name = "alwon_l3s_clkdm", 656 660 .main_clk = "timer1_fck", 657 - .dev_attr = &capability_alwon_dev_attr, 658 661 .class = &dm816x_timer_hwmod_class, 659 662 .flags = HWMOD_NO_IDLEST, 660 663 }; ··· 671 684 .modulemode = MODULEMODE_SWCTRL, 672 685 }, 673 686 }, 674 - .dev_attr = &capability_alwon_dev_attr, 675 687 .class = &dm816x_timer_hwmod_class, 676 688 }; 677 689 ··· 685 699 .name = "timer2", 686 700 .clkdm_name = "alwon_l3s_clkdm", 687 701 .main_clk = "timer2_fck", 688 - .dev_attr = &capability_alwon_dev_attr, 689 702 .class = &dm816x_timer_hwmod_class, 690 703 .flags = HWMOD_NO_IDLEST, 691 704 }; ··· 706 721 .modulemode = MODULEMODE_SWCTRL, 707 722 }, 708 723 }, 709 - .dev_attr = &capability_alwon_dev_attr, 710 724 .class = &dm816x_timer_hwmod_class, 711 725 }; 712 726 ··· 726 742 .modulemode = MODULEMODE_SWCTRL, 727 743 }, 728 744 }, 729 - .dev_attr = &capability_alwon_dev_attr, 730 745 .class = &dm816x_timer_hwmod_class, 731 746 }; 732 747 ··· 746 763 .modulemode = MODULEMODE_SWCTRL, 747 764 }, 748 765 }, 749 - .dev_attr = &capability_alwon_dev_attr, 750 766 .class = &dm816x_timer_hwmod_class, 751 767 }; 752 768 ··· 766 784 .modulemode = MODULEMODE_SWCTRL, 767 785 }, 768 786 }, 769 - .dev_attr = &capability_alwon_dev_attr, 770 787 .class = &dm816x_timer_hwmod_class, 771 788 }; 772 789 ··· 786 805 .modulemode = MODULEMODE_SWCTRL, 787 806 }, 788 807 }, 789 - .dev_attr = &capability_alwon_dev_attr, 790 808 .class = &dm816x_timer_hwmod_class, 791 809 }; 792 810 ··· 806 826 .modulemode = MODULEMODE_SWCTRL, 807 827 }, 808 828 }, 809 - .dev_attr = &capability_alwon_dev_attr, 810 829 .class = &dm816x_timer_hwmod_class, 811 830 }; 812 831 ··· 1117 1138 static struct omap_hwmod_class dm816x_mcspi_class = { 1118 1139 .name = "mcspi", 1119 1140 .sysc = &dm816x_mcspi_sysc, 1120 - .rev = OMAP3_MCSPI_REV, 1121 - }; 1122 - 1123 - static struct omap2_mcspi_dev_attr dm816x_mcspi1_dev_attr = { 1124 - .num_chipselect = 4, 1125 1141 }; 1126 1142 1127 1143 static struct omap_hwmod dm81xx_mcspi1_hwmod = { ··· 1130 1156 }, 1131 1157 }, 1132 1158 .class = &dm816x_mcspi_class, 1133 - .dev_attr = &dm816x_mcspi1_dev_attr, 1134 1159 }; 1135 1160 1136 1161 static struct omap_hwmod_ocp_if dm81xx_l4_ls__mcspi1 = {
-1
arch/arm/mach-omap2/omap_hwmod_common_data.h
··· 19 19 #include "display.h" 20 20 21 21 /* Common IP block data across OMAP2xxx */ 22 - extern struct omap_gpio_dev_attr omap2xxx_gpio_dev_attr; 23 22 extern struct omap_hwmod omap2xxx_l3_main_hwmod; 24 23 extern struct omap_hwmod omap2xxx_l4_core_hwmod; 25 24 extern struct omap_hwmod omap2xxx_l4_wkup_hwmod;
+53 -33
arch/arm/mach-omap2/pdata-quirks.c
··· 17 17 #include <linux/wl12xx.h> 18 18 #include <linux/mmc/card.h> 19 19 #include <linux/mmc/host.h> 20 + #include <linux/power/smartreflex.h> 20 21 #include <linux/regulator/machine.h> 21 22 #include <linux/regulator/fixed.h> 22 23 23 24 #include <linux/platform_data/pinctrl-single.h> 24 25 #include <linux/platform_data/hsmmc-omap.h> 25 26 #include <linux/platform_data/iommu-omap.h> 27 + #include <linux/platform_data/ti-sysc.h> 26 28 #include <linux/platform_data/wkup_m3.h> 27 - #include <linux/platform_data/pwm_omap_dmtimer.h> 28 29 #include <linux/platform_data/media/ir-rx51.h> 29 30 #include <linux/platform_data/asoc-ti-mcbsp.h> 30 - #include <plat/dmtimer.h> 31 31 32 32 #include "common.h" 33 33 #include "common-board-devices.h" ··· 454 454 } 455 455 #endif 456 456 457 + static int ti_sysc_enable_module(struct device *dev, 458 + const struct ti_sysc_cookie *cookie) 459 + { 460 + if (!cookie->data) 461 + return -EINVAL; 462 + 463 + return omap_hwmod_enable(cookie->data); 464 + } 465 + 466 + static int ti_sysc_idle_module(struct device *dev, 467 + const struct ti_sysc_cookie *cookie) 468 + { 469 + if (!cookie->data) 470 + return -EINVAL; 471 + 472 + return omap_hwmod_idle(cookie->data); 473 + } 474 + 475 + static int ti_sysc_shutdown_module(struct device *dev, 476 + const struct ti_sysc_cookie *cookie) 477 + { 478 + if (!cookie->data) 479 + return -EINVAL; 480 + 481 + return omap_hwmod_shutdown(cookie->data); 482 + } 483 + 484 + static struct of_dev_auxdata omap_auxdata_lookup[]; 485 + 486 + static struct ti_sysc_platform_data ti_sysc_pdata = { 487 + .auxdata = omap_auxdata_lookup, 488 + .init_module = omap_hwmod_init_module, 489 + .enable_module = ti_sysc_enable_module, 490 + .idle_module = ti_sysc_idle_module, 491 + .shutdown_module = ti_sysc_shutdown_module, 492 + }; 493 + 457 494 static struct pcs_pdata pcs_pdata; 458 495 459 496 void omap_pcs_legacy_init(int irq, void (*rearm)(void)) ··· 513 476 514 477 dev->platform_data = &twl_gpio_auxdata; 515 478 } 516 - 517 - /* Dual mode timer PWM callbacks platdata */ 518 - #if IS_ENABLED(CONFIG_OMAP_DM_TIMER) 519 - static struct pwm_omap_dmtimer_pdata pwm_dmtimer_pdata = { 520 - .request_by_node = omap_dm_timer_request_by_node, 521 - .request_specific = omap_dm_timer_request_specific, 522 - .request = omap_dm_timer_request, 523 - .set_source = omap_dm_timer_set_source, 524 - .get_irq = omap_dm_timer_get_irq, 525 - .set_int_enable = omap_dm_timer_set_int_enable, 526 - .set_int_disable = omap_dm_timer_set_int_disable, 527 - .free = omap_dm_timer_free, 528 - .enable = omap_dm_timer_enable, 529 - .disable = omap_dm_timer_disable, 530 - .get_fclk = omap_dm_timer_get_fclk, 531 - .start = omap_dm_timer_start, 532 - .stop = omap_dm_timer_stop, 533 - .set_load = omap_dm_timer_set_load, 534 - .set_match = omap_dm_timer_set_match, 535 - .set_pwm = omap_dm_timer_set_pwm, 536 - .set_prescaler = omap_dm_timer_set_prescaler, 537 - .read_counter = omap_dm_timer_read_counter, 538 - .write_counter = omap_dm_timer_write_counter, 539 - .read_status = omap_dm_timer_read_status, 540 - .write_status = omap_dm_timer_write_status, 541 - }; 542 - #endif 543 479 544 480 static struct ir_rx51_platform_data __maybe_unused rx51_ir_data = { 545 481 .set_max_mpu_wakeup_lat = omap_pm_set_max_mpu_wakeup_lat, ··· 552 542 { /* sentinel */ }, 553 543 }; 554 544 555 - static struct of_dev_auxdata omap_auxdata_lookup[] __initdata = { 545 + struct omap_sr_data __maybe_unused omap_sr_pdata[OMAP_SR_NR]; 546 + 547 + static struct of_dev_auxdata omap_auxdata_lookup[] = { 556 548 #ifdef CONFIG_MACH_NOKIA_N8X0 557 549 OF_DEV_AUXDATA("ti,omap2420-mmc", 0x4809c000, "mmci-omap.0", NULL), 558 550 OF_DEV_AUXDATA("menelaus", 0x72, "1-0072", &n8x0_menelaus_platform_data), ··· 563 551 #ifdef CONFIG_ARCH_OMAP3 564 552 OF_DEV_AUXDATA("ti,omap2-iommu", 0x5d000000, "5d000000.mmu", 565 553 &omap3_iommu_pdata), 554 + OF_DEV_AUXDATA("ti,omap3-smartreflex-core", 0x480cb000, 555 + "480cb000.smartreflex", &omap_sr_pdata[OMAP_SR_CORE]), 556 + OF_DEV_AUXDATA("ti,omap3-smartreflex-mpu-iva", 0x480c9000, 557 + "480c9000.smartreflex", &omap_sr_pdata[OMAP_SR_MPU]), 566 558 OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x4809c000, "4809c000.mmc", &mmc_pdata[0]), 567 559 OF_DEV_AUXDATA("ti,omap3-hsmmc", 0x480b4000, "480b4000.mmc", &mmc_pdata[1]), 568 560 OF_DEV_AUXDATA("nokia,n900-ir", 0, "n900-ir", &rx51_ir_data), ··· 588 572 OF_DEV_AUXDATA("ti,am4372-wkup-m3", 0x44d00000, "44d00000.wkup_m3", 589 573 &wkup_m3_data), 590 574 #endif 591 - #if IS_ENABLED(CONFIG_OMAP_DM_TIMER) 592 - OF_DEV_AUXDATA("ti,omap-dmtimer-pwm", 0, NULL, &pwm_dmtimer_pdata), 593 - #endif 594 575 #if defined(CONFIG_ARCH_OMAP4) || defined(CONFIG_SOC_OMAP5) 595 576 OF_DEV_AUXDATA("ti,omap4-iommu", 0x4a066000, "4a066000.mmu", 596 577 &omap4_iommu_pdata), 597 578 OF_DEV_AUXDATA("ti,omap4-iommu", 0x55082000, "55082000.mmu", 598 579 &omap4_iommu_pdata), 580 + OF_DEV_AUXDATA("ti,omap4-smartreflex-iva", 0x4a0db000, 581 + "4a0db000.smartreflex", &omap_sr_pdata[OMAP_SR_IVA]), 582 + OF_DEV_AUXDATA("ti,omap4-smartreflex-core", 0x4a0dd000, 583 + "4a0dd000.smartreflex", &omap_sr_pdata[OMAP_SR_CORE]), 584 + OF_DEV_AUXDATA("ti,omap4-smartreflex-mpu", 0x4a0d9000, 585 + "4a0d9000.smartreflex", &omap_sr_pdata[OMAP_SR_MPU]), 599 586 #endif 600 587 #ifdef CONFIG_SOC_DRA7XX 601 588 OF_DEV_AUXDATA("ti,dra7-hsmmc", 0x4809c000, "4809c000.mmc", ··· 609 590 &dra7_hsmmc_data_mmc3), 610 591 #endif 611 592 /* Common auxdata */ 593 + OF_DEV_AUXDATA("ti,sysc", 0, NULL, &ti_sysc_pdata), 612 594 OF_DEV_AUXDATA("pinctrl-single", 0, NULL, &pcs_pdata), 613 595 { /* sentinel */ }, 614 596 };
+31
arch/arm/mach-omap2/pm-asm-offsets.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * TI AM33XX and AM43XX PM Assembly Offsets 4 + * 5 + * Copyright (C) 2017-2018 Texas Instruments Inc. 6 + */ 7 + 8 + #include <linux/kbuild.h> 9 + #include <linux/platform_data/pm33xx.h> 10 + 11 + int main(void) 12 + { 13 + DEFINE(AMX3_PM_WFI_FLAGS_OFFSET, 14 + offsetof(struct am33xx_pm_sram_data, wfi_flags)); 15 + DEFINE(AMX3_PM_L2_AUX_CTRL_VAL_OFFSET, 16 + offsetof(struct am33xx_pm_sram_data, l2_aux_ctrl_val)); 17 + DEFINE(AMX3_PM_L2_PREFETCH_CTRL_VAL_OFFSET, 18 + offsetof(struct am33xx_pm_sram_data, l2_prefetch_ctrl_val)); 19 + DEFINE(AMX3_PM_SRAM_DATA_SIZE, sizeof(struct am33xx_pm_sram_data)); 20 + 21 + BLANK(); 22 + 23 + DEFINE(AMX3_PM_RO_SRAM_DATA_VIRT_OFFSET, 24 + offsetof(struct am33xx_pm_ro_sram_data, amx3_pm_sram_data_virt)); 25 + DEFINE(AMX3_PM_RO_SRAM_DATA_PHYS_OFFSET, 26 + offsetof(struct am33xx_pm_ro_sram_data, amx3_pm_sram_data_phys)); 27 + DEFINE(AMX3_PM_RO_SRAM_DATA_SIZE, 28 + sizeof(struct am33xx_pm_ro_sram_data)); 29 + 30 + return 0; 31 + }
+3
arch/arm/mach-omap2/pm.h
··· 81 81 /* ... and its pointer from SRAM after copy */ 82 82 extern void (*omap3_do_wfi_sram)(void); 83 83 84 + extern struct am33xx_pm_sram_addr am33xx_pm_sram; 85 + extern struct am33xx_pm_sram_addr am43xx_pm_sram; 86 + 84 87 extern void omap3_save_scratchpad_contents(void); 85 88 86 89 #define PM_RTA_ERRATUM_i608 (1 << 0)
+189
arch/arm/mach-omap2/pm33xx-core.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * AM33XX Arch Power Management Routines 4 + * 5 + * Copyright (C) 2016-2018 Texas Instruments Incorporated - http://www.ti.com/ 6 + * Dave Gerlach 7 + */ 8 + 9 + #include <asm/smp_scu.h> 10 + #include <asm/suspend.h> 11 + #include <linux/errno.h> 12 + #include <linux/platform_data/pm33xx.h> 13 + 14 + #include "cm33xx.h" 15 + #include "common.h" 16 + #include "control.h" 17 + #include "clockdomain.h" 18 + #include "iomap.h" 19 + #include "omap_hwmod.h" 20 + #include "pm.h" 21 + #include "powerdomain.h" 22 + #include "prm33xx.h" 23 + #include "soc.h" 24 + #include "sram.h" 25 + 26 + static struct powerdomain *cefuse_pwrdm, *gfx_pwrdm, *per_pwrdm, *mpu_pwrdm; 27 + static struct clockdomain *gfx_l4ls_clkdm; 28 + static void __iomem *scu_base; 29 + 30 + static int __init am43xx_map_scu(void) 31 + { 32 + scu_base = ioremap(scu_a9_get_base(), SZ_256); 33 + 34 + if (!scu_base) 35 + return -ENOMEM; 36 + 37 + return 0; 38 + } 39 + 40 + static int amx3_common_init(void) 41 + { 42 + gfx_pwrdm = pwrdm_lookup("gfx_pwrdm"); 43 + per_pwrdm = pwrdm_lookup("per_pwrdm"); 44 + mpu_pwrdm = pwrdm_lookup("mpu_pwrdm"); 45 + 46 + if ((!gfx_pwrdm) || (!per_pwrdm) || (!mpu_pwrdm)) 47 + return -ENODEV; 48 + 49 + (void)clkdm_for_each(omap_pm_clkdms_setup, NULL); 50 + 51 + /* CEFUSE domain can be turned off post bootup */ 52 + cefuse_pwrdm = pwrdm_lookup("cefuse_pwrdm"); 53 + if (cefuse_pwrdm) 54 + omap_set_pwrdm_state(cefuse_pwrdm, PWRDM_POWER_OFF); 55 + else 56 + pr_err("PM: Failed to get cefuse_pwrdm\n"); 57 + 58 + return 0; 59 + } 60 + 61 + static int am33xx_suspend_init(void) 62 + { 63 + int ret; 64 + 65 + gfx_l4ls_clkdm = clkdm_lookup("gfx_l4ls_gfx_clkdm"); 66 + 67 + if (!gfx_l4ls_clkdm) { 68 + pr_err("PM: Cannot lookup gfx_l4ls_clkdm clockdomains\n"); 69 + return -ENODEV; 70 + } 71 + 72 + ret = amx3_common_init(); 73 + 74 + return ret; 75 + } 76 + 77 + static int am43xx_suspend_init(void) 78 + { 79 + int ret = 0; 80 + 81 + ret = am43xx_map_scu(); 82 + if (ret) { 83 + pr_err("PM: Could not ioremap SCU\n"); 84 + return ret; 85 + } 86 + 87 + ret = amx3_common_init(); 88 + 89 + return ret; 90 + } 91 + 92 + static void amx3_pre_suspend_common(void) 93 + { 94 + omap_set_pwrdm_state(gfx_pwrdm, PWRDM_POWER_OFF); 95 + } 96 + 97 + static void amx3_post_suspend_common(void) 98 + { 99 + int status; 100 + /* 101 + * Because gfx_pwrdm is the only one under MPU control, 102 + * comment on transition status 103 + */ 104 + status = pwrdm_read_pwrst(gfx_pwrdm); 105 + if (status != PWRDM_POWER_OFF) 106 + pr_err("PM: GFX domain did not transition: %x\n", status); 107 + } 108 + 109 + static int am33xx_suspend(unsigned int state, int (*fn)(unsigned long)) 110 + { 111 + int ret = 0; 112 + 113 + amx3_pre_suspend_common(); 114 + ret = cpu_suspend(0, fn); 115 + amx3_post_suspend_common(); 116 + 117 + /* 118 + * BUG: GFX_L4LS clock domain needs to be woken up to 119 + * ensure thet L4LS clock domain does not get stuck in 120 + * transition. If that happens L3 module does not get 121 + * disabled, thereby leading to PER power domain 122 + * transition failing 123 + */ 124 + 125 + clkdm_wakeup(gfx_l4ls_clkdm); 126 + clkdm_sleep(gfx_l4ls_clkdm); 127 + 128 + return ret; 129 + } 130 + 131 + static int am43xx_suspend(unsigned int state, int (*fn)(unsigned long)) 132 + { 133 + int ret = 0; 134 + 135 + amx3_pre_suspend_common(); 136 + scu_power_mode(scu_base, SCU_PM_POWEROFF); 137 + ret = cpu_suspend(0, fn); 138 + scu_power_mode(scu_base, SCU_PM_NORMAL); 139 + amx3_post_suspend_common(); 140 + 141 + return ret; 142 + } 143 + 144 + static struct am33xx_pm_sram_addr *amx3_get_sram_addrs(void) 145 + { 146 + if (soc_is_am33xx()) 147 + return &am33xx_pm_sram; 148 + else if (soc_is_am437x()) 149 + return &am43xx_pm_sram; 150 + else 151 + return NULL; 152 + } 153 + 154 + static struct am33xx_pm_platform_data am33xx_ops = { 155 + .init = am33xx_suspend_init, 156 + .soc_suspend = am33xx_suspend, 157 + .get_sram_addrs = amx3_get_sram_addrs, 158 + }; 159 + 160 + static struct am33xx_pm_platform_data am43xx_ops = { 161 + .init = am43xx_suspend_init, 162 + .soc_suspend = am43xx_suspend, 163 + .get_sram_addrs = amx3_get_sram_addrs, 164 + }; 165 + 166 + static struct am33xx_pm_platform_data *am33xx_pm_get_pdata(void) 167 + { 168 + if (soc_is_am33xx()) 169 + return &am33xx_ops; 170 + else if (soc_is_am437x()) 171 + return &am43xx_ops; 172 + else 173 + return NULL; 174 + } 175 + 176 + void __init amx3_common_pm_init(void) 177 + { 178 + struct am33xx_pm_platform_data *pdata; 179 + struct platform_device_info devinfo; 180 + 181 + pdata = am33xx_pm_get_pdata(); 182 + 183 + memset(&devinfo, 0, sizeof(devinfo)); 184 + devinfo.name = "pm33xx"; 185 + devinfo.data = pdata; 186 + devinfo.size_data = sizeof(*pdata); 187 + devinfo.id = -1; 188 + platform_device_register_full(&devinfo); 189 + }
+214
arch/arm/mach-omap2/sleep33xx.S
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Low level suspend code for AM33XX SoCs 4 + * 5 + * Copyright (C) 2012-2018 Texas Instruments Incorporated - http://www.ti.com/ 6 + * Dave Gerlach, Vaibhav Bedia 7 + */ 8 + 9 + #include <generated/ti-emif-asm-offsets.h> 10 + #include <generated/ti-pm-asm-offsets.h> 11 + #include <linux/linkage.h> 12 + #include <linux/ti-emif-sram.h> 13 + #include <asm/assembler.h> 14 + #include <asm/memory.h> 15 + 16 + #include "iomap.h" 17 + #include "cm33xx.h" 18 + 19 + #define AM33XX_CM_CLKCTRL_MODULESTATE_DISABLED 0x00030000 20 + #define AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE 0x0003 21 + #define AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE 0x0002 22 + 23 + .arm 24 + .align 3 25 + 26 + ENTRY(am33xx_do_wfi) 27 + stmfd sp!, {r4 - r11, lr} @ save registers on stack 28 + 29 + /* 30 + * Flush all data from the L1 and L2 data cache before disabling 31 + * SCTLR.C bit. 32 + */ 33 + ldr r1, kernel_flush 34 + blx r1 35 + 36 + /* 37 + * Clear the SCTLR.C bit to prevent further data cache 38 + * allocation. Clearing SCTLR.C would make all the data accesses 39 + * strongly ordered and would not hit the cache. 40 + */ 41 + mrc p15, 0, r0, c1, c0, 0 42 + bic r0, r0, #(1 << 2) @ Disable the C bit 43 + mcr p15, 0, r0, c1, c0, 0 44 + isb 45 + 46 + /* 47 + * Invalidate L1 and L2 data cache. 48 + */ 49 + ldr r1, kernel_flush 50 + blx r1 51 + 52 + adr r9, am33xx_emif_sram_table 53 + 54 + ldr r3, [r9, #EMIF_PM_ENTER_SR_OFFSET] 55 + blx r3 56 + 57 + ldr r3, [r9, #EMIF_PM_SAVE_CONTEXT_OFFSET] 58 + blx r3 59 + 60 + /* Disable EMIF */ 61 + ldr r1, virt_emif_clkctrl 62 + ldr r2, [r1] 63 + bic r2, r2, #AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE 64 + str r2, [r1] 65 + 66 + ldr r1, virt_emif_clkctrl 67 + wait_emif_disable: 68 + ldr r2, [r1] 69 + mov r3, #AM33XX_CM_CLKCTRL_MODULESTATE_DISABLED 70 + cmp r2, r3 71 + bne wait_emif_disable 72 + 73 + /* 74 + * For the MPU WFI to be registered as an interrupt 75 + * to WKUP_M3, MPU_CLKCTRL.MODULEMODE needs to be set 76 + * to DISABLED 77 + */ 78 + ldr r1, virt_mpu_clkctrl 79 + ldr r2, [r1] 80 + bic r2, r2, #AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE 81 + str r2, [r1] 82 + 83 + /* 84 + * Execute an ISB instruction to ensure that all of the 85 + * CP15 register changes have been committed. 86 + */ 87 + isb 88 + 89 + /* 90 + * Execute a barrier instruction to ensure that all cache, 91 + * TLB and branch predictor maintenance operations issued 92 + * have completed. 93 + */ 94 + dsb 95 + dmb 96 + 97 + /* 98 + * Execute a WFI instruction and wait until the 99 + * STANDBYWFI output is asserted to indicate that the 100 + * CPU is in idle and low power state. CPU can specualatively 101 + * prefetch the instructions so add NOPs after WFI. Thirteen 102 + * NOPs as per Cortex-A8 pipeline. 103 + */ 104 + wfi 105 + 106 + nop 107 + nop 108 + nop 109 + nop 110 + nop 111 + nop 112 + nop 113 + nop 114 + nop 115 + nop 116 + nop 117 + nop 118 + nop 119 + 120 + /* We come here in case of an abort due to a late interrupt */ 121 + 122 + /* Set MPU_CLKCTRL.MODULEMODE back to ENABLE */ 123 + ldr r1, virt_mpu_clkctrl 124 + mov r2, #AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE 125 + str r2, [r1] 126 + 127 + /* Re-enable EMIF */ 128 + ldr r1, virt_emif_clkctrl 129 + mov r2, #AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE 130 + str r2, [r1] 131 + wait_emif_enable: 132 + ldr r3, [r1] 133 + cmp r2, r3 134 + bne wait_emif_enable 135 + 136 + 137 + ldr r1, [r9, #EMIF_PM_ABORT_SR_OFFSET] 138 + blx r1 139 + 140 + /* 141 + * Set SCTLR.C bit to allow data cache allocation 142 + */ 143 + mrc p15, 0, r0, c1, c0, 0 144 + orr r0, r0, #(1 << 2) @ Enable the C bit 145 + mcr p15, 0, r0, c1, c0, 0 146 + isb 147 + 148 + /* Let the suspend code know about the abort */ 149 + mov r0, #1 150 + ldmfd sp!, {r4 - r11, pc} @ restore regs and return 151 + ENDPROC(am33xx_do_wfi) 152 + 153 + .align 154 + ENTRY(am33xx_resume_offset) 155 + .word . - am33xx_do_wfi 156 + 157 + ENTRY(am33xx_resume_from_deep_sleep) 158 + /* Re-enable EMIF */ 159 + ldr r0, phys_emif_clkctrl 160 + mov r1, #AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE 161 + str r1, [r0] 162 + wait_emif_enable1: 163 + ldr r2, [r0] 164 + cmp r1, r2 165 + bne wait_emif_enable1 166 + 167 + adr r9, am33xx_emif_sram_table 168 + 169 + ldr r1, [r9, #EMIF_PM_RESTORE_CONTEXT_OFFSET] 170 + blx r1 171 + 172 + ldr r1, [r9, #EMIF_PM_EXIT_SR_OFFSET] 173 + blx r1 174 + 175 + resume_to_ddr: 176 + /* We are back. Branch to the common CPU resume routine */ 177 + mov r0, #0 178 + ldr pc, resume_addr 179 + ENDPROC(am33xx_resume_from_deep_sleep) 180 + 181 + /* 182 + * Local variables 183 + */ 184 + .align 185 + resume_addr: 186 + .word cpu_resume - PAGE_OFFSET + 0x80000000 187 + kernel_flush: 188 + .word v7_flush_dcache_all 189 + virt_mpu_clkctrl: 190 + .word AM33XX_CM_MPU_MPU_CLKCTRL 191 + virt_emif_clkctrl: 192 + .word AM33XX_CM_PER_EMIF_CLKCTRL 193 + phys_emif_clkctrl: 194 + .word (AM33XX_CM_BASE + AM33XX_CM_PER_MOD + \ 195 + AM33XX_CM_PER_EMIF_CLKCTRL_OFFSET) 196 + 197 + .align 3 198 + /* DDR related defines */ 199 + am33xx_emif_sram_table: 200 + .space EMIF_PM_FUNCTIONS_SIZE 201 + 202 + ENTRY(am33xx_pm_sram) 203 + .word am33xx_do_wfi 204 + .word am33xx_do_wfi_sz 205 + .word am33xx_resume_offset 206 + .word am33xx_emif_sram_table 207 + .word am33xx_pm_ro_sram_data 208 + 209 + .align 3 210 + ENTRY(am33xx_pm_ro_sram_data) 211 + .space AMX3_PM_RO_SRAM_DATA_SIZE 212 + 213 + ENTRY(am33xx_do_wfi_sz) 214 + .word . - am33xx_do_wfi
+391
arch/arm/mach-omap2/sleep43xx.S
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Low level suspend code for AM43XX SoCs 4 + * 5 + * Copyright (C) 2013-2018 Texas Instruments Incorporated - http://www.ti.com/ 6 + * Dave Gerlach, Vaibhav Bedia 7 + */ 8 + 9 + #include <generated/ti-emif-asm-offsets.h> 10 + #include <generated/ti-pm-asm-offsets.h> 11 + #include <linux/linkage.h> 12 + #include <linux/ti-emif-sram.h> 13 + 14 + #include <asm/assembler.h> 15 + #include <asm/hardware/cache-l2x0.h> 16 + #include <asm/memory.h> 17 + 18 + #include "cm33xx.h" 19 + #include "common.h" 20 + #include "iomap.h" 21 + #include "omap-secure.h" 22 + #include "omap44xx.h" 23 + #include "prm33xx.h" 24 + #include "prcm43xx.h" 25 + 26 + #define AM33XX_CM_CLKCTRL_MODULESTATE_DISABLED 0x00030000 27 + #define AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE 0x0003 28 + #define AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE 0x0002 29 + 30 + #define AM43XX_EMIF_POWEROFF_ENABLE 0x1 31 + #define AM43XX_EMIF_POWEROFF_DISABLE 0x0 32 + 33 + #define AM43XX_CM_CLKSTCTRL_CLKTRCTRL_SW_SLEEP 0x1 34 + #define AM43XX_CM_CLKSTCTRL_CLKTRCTRL_HW_AUTO 0x3 35 + 36 + #define AM43XX_CM_BASE 0x44DF0000 37 + 38 + #define AM43XX_CM_REGADDR(inst, reg) \ 39 + AM33XX_L4_WK_IO_ADDRESS(AM43XX_CM_BASE + (inst) + (reg)) 40 + 41 + #define AM43XX_CM_MPU_CLKSTCTRL AM43XX_CM_REGADDR(AM43XX_CM_MPU_INST, \ 42 + AM43XX_CM_MPU_MPU_CDOFFS) 43 + #define AM43XX_CM_MPU_MPU_CLKCTRL AM43XX_CM_REGADDR(AM43XX_CM_MPU_INST, \ 44 + AM43XX_CM_MPU_MPU_CLKCTRL_OFFSET) 45 + #define AM43XX_CM_PER_EMIF_CLKCTRL AM43XX_CM_REGADDR(AM43XX_CM_PER_INST, \ 46 + AM43XX_CM_PER_EMIF_CLKCTRL_OFFSET) 47 + #define AM43XX_PRM_EMIF_CTRL_OFFSET 0x0030 48 + 49 + .arm 50 + .align 3 51 + 52 + ENTRY(am43xx_do_wfi) 53 + stmfd sp!, {r4 - r11, lr} @ save registers on stack 54 + 55 + #ifdef CONFIG_CACHE_L2X0 56 + /* Retrieve l2 cache virt address BEFORE we shut off EMIF */ 57 + ldr r1, get_l2cache_base 58 + blx r1 59 + mov r8, r0 60 + #endif 61 + 62 + /* 63 + * Flush all data from the L1 and L2 data cache before disabling 64 + * SCTLR.C bit. 65 + */ 66 + ldr r1, kernel_flush 67 + blx r1 68 + 69 + /* 70 + * Clear the SCTLR.C bit to prevent further data cache 71 + * allocation. Clearing SCTLR.C would make all the data accesses 72 + * strongly ordered and would not hit the cache. 73 + */ 74 + mrc p15, 0, r0, c1, c0, 0 75 + bic r0, r0, #(1 << 2) @ Disable the C bit 76 + mcr p15, 0, r0, c1, c0, 0 77 + isb 78 + dsb 79 + 80 + /* 81 + * Invalidate L1 and L2 data cache. 82 + */ 83 + ldr r1, kernel_flush 84 + blx r1 85 + 86 + #ifdef CONFIG_CACHE_L2X0 87 + /* 88 + * Clean and invalidate the L2 cache. 89 + */ 90 + #ifdef CONFIG_PL310_ERRATA_727915 91 + mov r0, #0x03 92 + mov r12, #OMAP4_MON_L2X0_DBG_CTRL_INDEX 93 + dsb 94 + smc #0 95 + dsb 96 + #endif 97 + mov r0, r8 98 + adr r4, am43xx_pm_ro_sram_data 99 + ldr r3, [r4, #AMX3_PM_RO_SRAM_DATA_VIRT_OFFSET] 100 + 101 + mov r2, r0 102 + ldr r0, [r2, #L2X0_AUX_CTRL] 103 + str r0, [r3, #AMX3_PM_L2_AUX_CTRL_VAL_OFFSET] 104 + ldr r0, [r2, #L310_PREFETCH_CTRL] 105 + str r0, [r3, #AMX3_PM_L2_PREFETCH_CTRL_VAL_OFFSET] 106 + 107 + ldr r0, l2_val 108 + str r0, [r2, #L2X0_CLEAN_INV_WAY] 109 + wait: 110 + ldr r0, [r2, #L2X0_CLEAN_INV_WAY] 111 + ldr r1, l2_val 112 + ands r0, r0, r1 113 + bne wait 114 + #ifdef CONFIG_PL310_ERRATA_727915 115 + mov r0, #0x00 116 + mov r12, #OMAP4_MON_L2X0_DBG_CTRL_INDEX 117 + dsb 118 + smc #0 119 + dsb 120 + #endif 121 + l2x_sync: 122 + mov r0, r8 123 + mov r2, r0 124 + mov r0, #0x0 125 + str r0, [r2, #L2X0_CACHE_SYNC] 126 + sync: 127 + ldr r0, [r2, #L2X0_CACHE_SYNC] 128 + ands r0, r0, #0x1 129 + bne sync 130 + #endif 131 + 132 + adr r9, am43xx_emif_sram_table 133 + 134 + ldr r3, [r9, #EMIF_PM_ENTER_SR_OFFSET] 135 + blx r3 136 + 137 + ldr r3, [r9, #EMIF_PM_SAVE_CONTEXT_OFFSET] 138 + blx r3 139 + 140 + /* Disable EMIF */ 141 + ldr r1, am43xx_virt_emif_clkctrl 142 + ldr r2, [r1] 143 + bic r2, r2, #AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE 144 + str r2, [r1] 145 + 146 + wait_emif_disable: 147 + ldr r2, [r1] 148 + mov r3, #AM33XX_CM_CLKCTRL_MODULESTATE_DISABLED 149 + cmp r2, r3 150 + bne wait_emif_disable 151 + 152 + /* 153 + * For the MPU WFI to be registered as an interrupt 154 + * to WKUP_M3, MPU_CLKCTRL.MODULEMODE needs to be set 155 + * to DISABLED 156 + */ 157 + ldr r1, am43xx_virt_mpu_clkctrl 158 + ldr r2, [r1] 159 + bic r2, r2, #AM33XX_CM_CLKCTRL_MODULEMODE_DISABLE 160 + str r2, [r1] 161 + 162 + /* 163 + * Put MPU CLKDM to SW_SLEEP 164 + */ 165 + ldr r1, am43xx_virt_mpu_clkstctrl 166 + mov r2, #AM43XX_CM_CLKSTCTRL_CLKTRCTRL_SW_SLEEP 167 + str r2, [r1] 168 + 169 + /* 170 + * Execute a barrier instruction to ensure that all cache, 171 + * TLB and branch predictor maintenance operations issued 172 + * have completed. 173 + */ 174 + dsb 175 + dmb 176 + 177 + /* 178 + * Execute a WFI instruction and wait until the 179 + * STANDBYWFI output is asserted to indicate that the 180 + * CPU is in idle and low power state. CPU can specualatively 181 + * prefetch the instructions so add NOPs after WFI. Sixteen 182 + * NOPs as per Cortex-A9 pipeline. 183 + */ 184 + wfi 185 + 186 + nop 187 + nop 188 + nop 189 + nop 190 + nop 191 + nop 192 + nop 193 + nop 194 + nop 195 + nop 196 + nop 197 + nop 198 + nop 199 + nop 200 + nop 201 + nop 202 + 203 + /* We come here in case of an abort due to a late interrupt */ 204 + ldr r1, am43xx_virt_mpu_clkstctrl 205 + mov r2, #AM43XX_CM_CLKSTCTRL_CLKTRCTRL_HW_AUTO 206 + str r2, [r1] 207 + 208 + /* Set MPU_CLKCTRL.MODULEMODE back to ENABLE */ 209 + ldr r1, am43xx_virt_mpu_clkctrl 210 + mov r2, #AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE 211 + str r2, [r1] 212 + 213 + /* Re-enable EMIF */ 214 + ldr r1, am43xx_virt_emif_clkctrl 215 + mov r2, #AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE 216 + str r2, [r1] 217 + wait_emif_enable: 218 + ldr r3, [r1] 219 + cmp r2, r3 220 + bne wait_emif_enable 221 + 222 + /* 223 + * Set SCTLR.C bit to allow data cache allocation 224 + */ 225 + mrc p15, 0, r0, c1, c0, 0 226 + orr r0, r0, #(1 << 2) @ Enable the C bit 227 + mcr p15, 0, r0, c1, c0, 0 228 + isb 229 + 230 + ldr r1, [r9, #EMIF_PM_ABORT_SR_OFFSET] 231 + blx r1 232 + 233 + /* Let the suspend code know about the abort */ 234 + mov r0, #1 235 + ldmfd sp!, {r4 - r11, pc} @ restore regs and return 236 + ENDPROC(am43xx_do_wfi) 237 + 238 + .align 239 + ENTRY(am43xx_resume_offset) 240 + .word . - am43xx_do_wfi 241 + 242 + ENTRY(am43xx_resume_from_deep_sleep) 243 + /* Set MPU CLKSTCTRL to HW AUTO so that CPUidle works properly */ 244 + ldr r1, am43xx_virt_mpu_clkstctrl 245 + mov r2, #AM43XX_CM_CLKSTCTRL_CLKTRCTRL_HW_AUTO 246 + str r2, [r1] 247 + 248 + /* For AM43xx, use EMIF power down until context is restored */ 249 + ldr r2, am43xx_phys_emif_poweroff 250 + mov r1, #AM43XX_EMIF_POWEROFF_ENABLE 251 + str r1, [r2, #0x0] 252 + 253 + /* Re-enable EMIF */ 254 + ldr r1, am43xx_phys_emif_clkctrl 255 + mov r2, #AM33XX_CM_CLKCTRL_MODULEMODE_ENABLE 256 + str r2, [r1] 257 + wait_emif_enable1: 258 + ldr r3, [r1] 259 + cmp r2, r3 260 + bne wait_emif_enable1 261 + 262 + adr r9, am43xx_emif_sram_table 263 + 264 + ldr r1, [r9, #EMIF_PM_RESTORE_CONTEXT_OFFSET] 265 + blx r1 266 + 267 + ldr r1, [r9, #EMIF_PM_EXIT_SR_OFFSET] 268 + blx r1 269 + 270 + ldr r2, am43xx_phys_emif_poweroff 271 + mov r1, #AM43XX_EMIF_POWEROFF_DISABLE 272 + str r1, [r2, #0x0] 273 + 274 + #ifdef CONFIG_CACHE_L2X0 275 + ldr r2, l2_cache_base 276 + ldr r0, [r2, #L2X0_CTRL] 277 + and r0, #0x0f 278 + cmp r0, #1 279 + beq skip_l2en @ Skip if already enabled 280 + 281 + adr r4, am43xx_pm_ro_sram_data 282 + ldr r3, [r4, #AMX3_PM_RO_SRAM_DATA_PHYS_OFFSET] 283 + ldr r0, [r3, #AMX3_PM_L2_PREFETCH_CTRL_VAL_OFFSET] 284 + 285 + ldr r12, l2_smc1 286 + dsb 287 + smc #0 288 + dsb 289 + set_aux_ctrl: 290 + ldr r0, [r3, #AMX3_PM_L2_AUX_CTRL_VAL_OFFSET] 291 + ldr r12, l2_smc2 292 + dsb 293 + smc #0 294 + dsb 295 + 296 + /* L2 invalidate on resume */ 297 + ldr r0, l2_val 298 + ldr r2, l2_cache_base 299 + str r0, [r2, #L2X0_INV_WAY] 300 + wait2: 301 + ldr r0, [r2, #L2X0_INV_WAY] 302 + ldr r1, l2_val 303 + ands r0, r0, r1 304 + bne wait2 305 + #ifdef CONFIG_PL310_ERRATA_727915 306 + mov r0, #0x00 307 + mov r12, #OMAP4_MON_L2X0_DBG_CTRL_INDEX 308 + dsb 309 + smc #0 310 + dsb 311 + #endif 312 + l2x_sync2: 313 + ldr r2, l2_cache_base 314 + mov r0, #0x0 315 + str r0, [r2, #L2X0_CACHE_SYNC] 316 + sync2: 317 + ldr r0, [r2, #L2X0_CACHE_SYNC] 318 + ands r0, r0, #0x1 319 + bne sync2 320 + 321 + mov r0, #0x1 322 + ldr r12, l2_smc3 323 + dsb 324 + smc #0 325 + dsb 326 + #endif 327 + skip_l2en: 328 + /* We are back. Branch to the common CPU resume routine */ 329 + mov r0, #0 330 + ldr pc, resume_addr 331 + ENDPROC(am43xx_resume_from_deep_sleep) 332 + 333 + /* 334 + * Local variables 335 + */ 336 + .align 337 + resume_addr: 338 + .word cpu_resume - PAGE_OFFSET + 0x80000000 339 + kernel_flush: 340 + .word v7_flush_dcache_all 341 + ddr_start: 342 + .word PAGE_OFFSET 343 + 344 + am43xx_phys_emif_poweroff: 345 + .word (AM43XX_CM_BASE + AM43XX_PRM_DEVICE_INST + \ 346 + AM43XX_PRM_EMIF_CTRL_OFFSET) 347 + am43xx_virt_mpu_clkstctrl: 348 + .word (AM43XX_CM_MPU_CLKSTCTRL) 349 + am43xx_virt_mpu_clkctrl: 350 + .word (AM43XX_CM_MPU_MPU_CLKCTRL) 351 + am43xx_virt_emif_clkctrl: 352 + .word (AM43XX_CM_PER_EMIF_CLKCTRL) 353 + am43xx_phys_emif_clkctrl: 354 + .word (AM43XX_CM_BASE + AM43XX_CM_PER_INST + \ 355 + AM43XX_CM_PER_EMIF_CLKCTRL_OFFSET) 356 + 357 + #ifdef CONFIG_CACHE_L2X0 358 + /* L2 cache related defines for AM437x */ 359 + get_l2cache_base: 360 + .word omap4_get_l2cache_base 361 + l2_cache_base: 362 + .word OMAP44XX_L2CACHE_BASE 363 + l2_smc1: 364 + .word OMAP4_MON_L2X0_PREFETCH_INDEX 365 + l2_smc2: 366 + .word OMAP4_MON_L2X0_AUXCTRL_INDEX 367 + l2_smc3: 368 + .word OMAP4_MON_L2X0_CTRL_INDEX 369 + l2_val: 370 + .word 0xffff 371 + #endif 372 + 373 + .align 3 374 + /* DDR related defines */ 375 + ENTRY(am43xx_emif_sram_table) 376 + .space EMIF_PM_FUNCTIONS_SIZE 377 + 378 + ENTRY(am43xx_pm_sram) 379 + .word am43xx_do_wfi 380 + .word am43xx_do_wfi_sz 381 + .word am43xx_resume_offset 382 + .word am43xx_emif_sram_table 383 + .word am43xx_pm_ro_sram_data 384 + 385 + .align 3 386 + 387 + ENTRY(am43xx_pm_ro_sram_data) 388 + .space AMX3_PM_RO_SRAM_DATA_SIZE 389 + 390 + ENTRY(am43xx_do_wfi_sz) 391 + .word . - am43xx_do_wfi
+1 -6
arch/arm/mach-omap2/sleep44xx.S
··· 90 90 mcr p15, 0, r0, c1, c0, 0 91 91 isb 92 92 93 - /* 94 - * Invalidate L1 data cache. Even though only invalidate is 95 - * necessary exported flush API is used here. Doing clean 96 - * on already clean cache would be almost NOP. 97 - */ 98 - bl v7_flush_dcache_all 93 + bl v7_invalidate_l1 99 94 100 95 /* 101 96 * Switch the CPU from Symmetric Multiprocessing (SMP) mode
+16 -11
arch/arm/mach-omap2/sr_device.c
··· 89 89 sr_data->nvalue_count = j; 90 90 } 91 91 92 + extern struct omap_sr_data omap_sr_pdata[]; 93 + 92 94 static int __init sr_dev_init(struct omap_hwmod *oh, void *user) 93 95 { 94 - struct omap_sr_data *sr_data; 95 - struct platform_device *pdev; 96 + struct omap_sr_data *sr_data = NULL; 96 97 struct omap_volt_data *volt_data; 97 98 struct omap_smartreflex_dev_attr *sr_dev_attr; 98 - char *name = "smartreflex"; 99 99 static int i; 100 100 101 - sr_data = kzalloc(sizeof(*sr_data), GFP_KERNEL); 102 - if (!sr_data) 103 - return -ENOMEM; 101 + if (!strncmp(oh->name, "smartreflex_mpu_iva", 20) || 102 + !strncmp(oh->name, "smartreflex_mpu", 16)) 103 + sr_data = &omap_sr_pdata[OMAP_SR_MPU]; 104 + else if (!strncmp(oh->name, "smartreflex_core", 17)) 105 + sr_data = &omap_sr_pdata[OMAP_SR_CORE]; 106 + else if (!strncmp(oh->name, "smartreflex_iva", 16)) 107 + sr_data = &omap_sr_pdata[OMAP_SR_IVA]; 108 + 109 + if (!sr_data) { 110 + pr_err("%s: Unknown instance %s\n", __func__, oh->name); 111 + return -EINVAL; 112 + } 104 113 105 114 sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr; 106 115 if (!sr_dev_attr || !sr_dev_attr->sensor_voltdm_name) { ··· 154 145 155 146 sr_data->enable_on_init = sr_enable_on_init; 156 147 157 - pdev = omap_device_build(name, i, oh, sr_data, sizeof(*sr_data)); 158 - if (IS_ERR(pdev)) 159 - pr_warn("%s: Could not build omap_device for %s: %s\n", 160 - __func__, name, oh->name); 161 148 exit: 162 149 i++; 163 - kfree(sr_data); 150 + 164 151 return 0; 165 152 } 166 153
+1 -1
arch/arm/mach-omap2/timer.c
··· 49 49 #include "omap_hwmod.h" 50 50 #include "omap_device.h" 51 51 #include <plat/counter-32k.h> 52 - #include <plat/dmtimer.h> 52 + #include <clocksource/timer-ti-dm.h> 53 53 #include "omap-pm.h" 54 54 55 55 #include "soc.h"
+6 -8
arch/arm/mach-pxa/cm-x300.c
··· 404 404 static inline void cm_x300_init_ac97(void) {} 405 405 #endif 406 406 407 - #if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) 407 + #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL) 408 408 static struct mtd_partition cm_x300_nand_partitions[] = { 409 409 [0] = { 410 410 .name = "OBM", ··· 442 442 }; 443 443 444 444 static struct pxa3xx_nand_platform_data cm_x300_nand_info = { 445 - .enable_arbiter = 1, 446 445 .keep_config = 1, 447 - .num_cs = 1, 448 - .parts[0] = cm_x300_nand_partitions, 449 - .nr_parts[0] = ARRAY_SIZE(cm_x300_nand_partitions), 446 + .parts = cm_x300_nand_partitions, 447 + .nr_parts = ARRAY_SIZE(cm_x300_nand_partitions), 450 448 }; 451 449 452 450 static void __init cm_x300_init_nand(void) ··· 520 522 return 0; 521 523 } 522 524 523 - static inline int cm_x300_u2d_init(struct device *dev) 525 + static int cm_x300_u2d_init(struct device *dev) 524 526 { 525 527 int err = 0; 526 528 ··· 532 534 pr_err("failed to get CLK_POUT: %d\n", err); 533 535 return err; 534 536 } 535 - clk_enable(pout_clk); 537 + clk_prepare_enable(pout_clk); 536 538 537 539 err = cm_x300_ulpi_phy_reset(); 538 540 if (err) { ··· 547 549 static void cm_x300_u2d_exit(struct device *dev) 548 550 { 549 551 if (cpu_is_pxa310()) { 550 - clk_disable(pout_clk); 552 + clk_disable_unprepare(pout_clk); 551 553 clk_put(pout_clk); 552 554 } 553 555 }
+3 -5
arch/arm/mach-pxa/colibri-pxa3xx.c
··· 110 110 } 111 111 #endif 112 112 113 - #if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) 113 + #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL) 114 114 static struct mtd_partition colibri_nand_partitions[] = { 115 115 { 116 116 .name = "bootloader", ··· 138 138 }; 139 139 140 140 static struct pxa3xx_nand_platform_data colibri_nand_info = { 141 - .enable_arbiter = 1, 142 141 .keep_config = 1, 143 - .num_cs = 1, 144 - .parts[0] = colibri_nand_partitions, 145 - .nr_parts[0] = ARRAY_SIZE(colibri_nand_partitions), 142 + .parts = colibri_nand_partitions, 143 + .nr_parts = ARRAY_SIZE(colibri_nand_partitions), 146 144 }; 147 145 148 146 void __init colibri_pxa3xx_init_nand(void)
+1 -1
arch/arm/mach-pxa/colibri.h
··· 46 46 extern void colibri_pxa3xx_init_eth(struct ax_plat_data *plat_data); 47 47 #endif 48 48 49 - #if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) 49 + #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL) 50 50 extern void colibri_pxa3xx_init_nand(void); 51 51 #else 52 52 static inline void colibri_pxa3xx_init_nand(void) {}
+4 -6
arch/arm/mach-pxa/littleton.c
··· 291 291 static inline void littleton_init_mmc(void) {} 292 292 #endif 293 293 294 - #if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) 294 + #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL) 295 295 static struct mtd_partition littleton_nand_partitions[] = { 296 296 [0] = { 297 297 .name = "Bootloader", ··· 329 329 }; 330 330 331 331 static struct pxa3xx_nand_platform_data littleton_nand_info = { 332 - .enable_arbiter = 1, 333 - .num_cs = 1, 334 - .parts[0] = littleton_nand_partitions, 335 - .nr_parts[0] = ARRAY_SIZE(littleton_nand_partitions), 332 + .parts = littleton_nand_partitions, 333 + .nr_parts = ARRAY_SIZE(littleton_nand_partitions), 336 334 }; 337 335 338 336 static void __init littleton_init_nand(void) ··· 339 341 } 340 342 #else 341 343 static inline void littleton_init_nand(void) {} 342 - #endif /* CONFIG_MTD_NAND_PXA3xx || CONFIG_MTD_NAND_PXA3xx_MODULE */ 344 + #endif /* IS_ENABLED(CONFIG_MTD_NAND_MARVELL) */ 343 345 344 346 #if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE) 345 347 static struct led_info littleton_da9034_leds[] = {
+4 -6
arch/arm/mach-pxa/mxm8x10.c
··· 359 359 } 360 360 361 361 /* NAND flash Support */ 362 - #if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) 362 + #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL) 363 363 #define NAND_BLOCK_SIZE SZ_128K 364 364 #define NB(x) (NAND_BLOCK_SIZE * (x)) 365 365 static struct mtd_partition mxm_8x10_nand_partitions[] = { ··· 389 389 }; 390 390 391 391 static struct pxa3xx_nand_platform_data mxm_8x10_nand_info = { 392 - .enable_arbiter = 1, 393 392 .keep_config = 1, 394 - .num_cs = 1, 395 - .parts[0] = mxm_8x10_nand_partitions, 396 - .nr_parts[0] = ARRAY_SIZE(mxm_8x10_nand_partitions) 393 + .parts = mxm_8x10_nand_partitions, 394 + .nr_parts = ARRAY_SIZE(mxm_8x10_nand_partitions) 397 395 }; 398 396 399 397 static void __init mxm_8x10_nand_init(void) ··· 400 402 } 401 403 #else 402 404 static inline void mxm_8x10_nand_init(void) {} 403 - #endif /* CONFIG_MTD_NAND_PXA3xx || CONFIG_MTD_NAND_PXA3xx_MODULE */ 405 + #endif /* IS_ENABLED(CONFIG_MTD_NAND_MARVELL) */ 404 406 405 407 /* Ethernet support: Davicom DM9000 */ 406 408 static struct resource dm9k_resources[] = {
+3 -3
arch/arm/mach-pxa/pxa3xx-ulpi.c
··· 256 256 if (!u2d) 257 257 return 0; 258 258 259 - clk_enable(u2d->clk); 259 + clk_prepare_enable(u2d->clk); 260 260 261 261 if (cpu_is_pxa310()) { 262 262 pxa310_u2d_setup_otg_hc(); ··· 276 276 if (cpu_is_pxa310()) 277 277 pxa310_stop_otg_hc(); 278 278 279 - clk_disable(u2d->clk); 279 + clk_disable_unprepare(u2d->clk); 280 280 } 281 281 EXPORT_SYMBOL_GPL(pxa3xx_u2d_stop_hc); 282 282 ··· 331 331 goto err_free_plat; 332 332 } 333 333 334 - platform_set_drvdata(pdev, &u2d); 334 + platform_set_drvdata(pdev, u2d); 335 335 336 336 return 0; 337 337
+5 -7
arch/arm/mach-pxa/raumfeld.c
··· 346 346 }; 347 347 348 348 static struct pxa3xx_nand_platform_data raumfeld_nand_info = { 349 - .enable_arbiter = 1, 350 349 .keep_config = 1, 351 - .num_cs = 1, 352 - .parts[0] = raumfeld_nand_partitions, 353 - .nr_parts[0] = ARRAY_SIZE(raumfeld_nand_partitions), 350 + .parts = raumfeld_nand_partitions, 351 + .nr_parts = ARRAY_SIZE(raumfeld_nand_partitions), 354 352 }; 355 353 356 354 /** ··· 376 378 }; 377 379 378 380 static const struct property_entry raumfeld_rotary_properties[] __initconst = { 379 - PROPERTY_ENTRY_INTEGER("rotary-encoder,steps-per-period", u32, 24), 380 - PROPERTY_ENTRY_INTEGER("linux,axis", u32, REL_X), 381 - PROPERTY_ENTRY_INTEGER("rotary-encoder,relative_axis", u32, 1), 381 + PROPERTY_ENTRY_U32("rotary-encoder,steps-per-period", 24), 382 + PROPERTY_ENTRY_U32("linux,axis", REL_X), 383 + PROPERTY_ENTRY_U32("rotary-encoder,relative_axis", 1), 382 384 { }, 383 385 }; 384 386
+4 -6
arch/arm/mach-pxa/zylonite.c
··· 338 338 static inline void zylonite_init_keypad(void) {} 339 339 #endif 340 340 341 - #if defined(CONFIG_MTD_NAND_PXA3xx) || defined(CONFIG_MTD_NAND_PXA3xx_MODULE) 341 + #if IS_ENABLED(CONFIG_MTD_NAND_MARVELL) 342 342 static struct mtd_partition zylonite_nand_partitions[] = { 343 343 [0] = { 344 344 .name = "Bootloader", ··· 376 376 }; 377 377 378 378 static struct pxa3xx_nand_platform_data zylonite_nand_info = { 379 - .enable_arbiter = 1, 380 - .num_cs = 1, 381 - .parts[0] = zylonite_nand_partitions, 382 - .nr_parts[0] = ARRAY_SIZE(zylonite_nand_partitions), 379 + .parts = zylonite_nand_partitions, 380 + .nr_parts = ARRAY_SIZE(zylonite_nand_partitions), 383 381 }; 384 382 385 383 static void __init zylonite_init_nand(void) ··· 386 388 } 387 389 #else 388 390 static inline void zylonite_init_nand(void) {} 389 - #endif /* CONFIG_MTD_NAND_PXA3xx || CONFIG_MTD_NAND_PXA3xx_MODULE */ 391 + #endif /* IS_ENABLED(CONFIG_MTD_NAND_MARVELL) */ 390 392 391 393 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) 392 394 static struct pxaohci_platform_data zylonite_ohci_info = {
+1
arch/arm/mach-rockchip/platsmp.c
··· 208 208 } 209 209 210 210 static const struct regmap_config rockchip_pmu_regmap_config = { 211 + .name = "rockchip-pmu", 211 212 .reg_bits = 32, 212 213 .val_bits = 32, 213 214 .reg_stride = 4,
+4
arch/arm/mach-shmobile/common.h
··· 7 7 extern void shmobile_boot_vector(void); 8 8 extern unsigned long shmobile_boot_fn; 9 9 extern unsigned long shmobile_boot_size; 10 + extern void shmobile_boot_vector_gen2(void); 11 + extern unsigned long shmobile_boot_fn_gen2; 12 + extern unsigned long shmobile_boot_cpu_gen2; 13 + extern unsigned long shmobile_boot_size_gen2; 10 14 extern void shmobile_smp_boot(void); 11 15 extern void shmobile_smp_sleep(void); 12 16 extern void shmobile_smp_hook(unsigned int cpu, unsigned long fn,
+55
arch/arm/mach-shmobile/headsmp.S
··· 16 16 #include <asm/assembler.h> 17 17 #include <asm/memory.h> 18 18 19 + #define SCTLR_MMU 0x01 20 + #define BOOTROM_ADDRESS 0xE6340000 21 + #define RWTCSRA_ADDRESS 0xE6020004 22 + #define RWTCSRA_WOVF 0x10 23 + 19 24 /* 20 25 * Reset vector for secondary CPUs. 21 26 * This will be mapped at address 0 by SBAR register. ··· 41 36 .globl shmobile_boot_size 42 37 shmobile_boot_size: 43 38 .long . - shmobile_boot_vector 39 + 40 + #ifdef CONFIG_ARCH_RCAR_GEN2 41 + /* 42 + * Reset vector for R-Car Gen2 and RZ/G1 secondary CPUs. 43 + * This will be mapped at address 0 by SBAR register. 44 + */ 45 + ENTRY(shmobile_boot_vector_gen2) 46 + mrc p15, 0, r0, c0, c0, 5 @ r0 = MPIDR 47 + ldr r1, shmobile_boot_cpu_gen2 48 + cmp r0, r1 49 + bne shmobile_smp_continue_gen2 50 + 51 + mrc p15, 0, r1, c1, c0, 0 @ r1 = SCTLR 52 + and r0, r1, #SCTLR_MMU 53 + cmp r0, #SCTLR_MMU 54 + beq shmobile_smp_continue_gen2 55 + 56 + ldr r0, rwtcsra 57 + mov r1, #0 58 + ldrb r1, [r0] 59 + and r0, r1, #RWTCSRA_WOVF 60 + cmp r0, #RWTCSRA_WOVF 61 + bne shmobile_smp_continue_gen2 62 + 63 + ldr r0, bootrom 64 + bx r0 65 + 66 + shmobile_smp_continue_gen2: 67 + ldr r1, shmobile_boot_fn_gen2 68 + bx r1 69 + 70 + ENDPROC(shmobile_boot_vector_gen2) 71 + 72 + .align 4 73 + rwtcsra: 74 + .word RWTCSRA_ADDRESS 75 + bootrom: 76 + .word BOOTROM_ADDRESS 77 + .globl shmobile_boot_cpu_gen2 78 + shmobile_boot_cpu_gen2: 79 + .word 0x00000000 80 + 81 + .align 2 82 + .globl shmobile_boot_fn_gen2 83 + shmobile_boot_fn_gen2: 84 + .space 4 85 + .globl shmobile_boot_size_gen2 86 + shmobile_boot_size_gen2: 87 + .long . - shmobile_boot_vector_gen2 88 + #endif /* CONFIG_ARCH_RCAR_GEN2 */ 44 89 45 90 /* 46 91 * Per-CPU SMP boot function/argument selection code based on MPIDR
+1
arch/arm/mach-shmobile/platsmp-apmu.c
··· 191 191 { 192 192 /* install boot code shared by all CPUs */ 193 193 shmobile_boot_fn = __pa_symbol(shmobile_smp_boot); 194 + shmobile_boot_fn_gen2 = shmobile_boot_fn; 194 195 } 195 196 196 197 void __init shmobile_smp_apmu_prepare_cpus(unsigned int max_cpus,
+12 -3
arch/arm/mach-shmobile/pm-rcar-gen2.c
··· 17 17 #include <linux/smp.h> 18 18 #include <linux/soc/renesas/rcar-sysc.h> 19 19 #include <asm/io.h> 20 + #include <asm/cputype.h> 20 21 #include "common.h" 21 22 #include "rcar-gen2.h" 22 23 ··· 37 36 #define CA15RESCNT_CPUS 0xf /* CPU0-3 */ 38 37 #define CA7RESCNT_CODE 0x5a5a0000 39 38 #define CA7RESCNT_CPUS 0xf /* CPU0-3 */ 40 - 41 39 42 40 /* On-chip RAM */ 43 41 #define ICRAM1 0xe63c0000 /* Inter Connect RAM1 (4 KiB) */ ··· 119 119 p = ioremap(res.start, resource_size(&res)); 120 120 if (!p) 121 121 return; 122 - 123 - memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); 122 + /* 123 + * install the reset vector, use the largest version if we have enough 124 + * memory available 125 + */ 126 + if (resource_size(&res) >= shmobile_boot_size_gen2) { 127 + shmobile_boot_cpu_gen2 = read_cpuid_mpidr(); 128 + memcpy_toio(p, shmobile_boot_vector_gen2, 129 + shmobile_boot_size_gen2); 130 + } else { 131 + memcpy_toio(p, shmobile_boot_vector, shmobile_boot_size); 132 + } 124 133 iounmap(p); 125 134 126 135 /* setup reset vectors */
+17 -8
arch/arm/mach-shmobile/regulator-quirk-rcar-gen2.c
··· 1 1 /* 2 2 * R-Car Generation 2 da9063/da9210 regulator quirk 3 3 * 4 - * The r8a7790/lager and r8a7791/koelsch development boards have da9063 and 5 - * da9210 regulators. Both regulators have their interrupt request lines tied 6 - * to the same interrupt pin (IRQ2) on the SoC. 4 + * Certain Gen2 development boards have an da9063 and one or more da9210 5 + * regulators. All of these regulators have their interrupt request lines 6 + * tied to the same interrupt pin (IRQ2) on the SoC. 7 7 * 8 8 * After cold boot or da9063-induced restart, both the da9063 and da9210 seem 9 9 * to assert their interrupt request lines. Hence as soon as one driver ··· 50 50 static u8 da9063_irq_clr[] = { DA9063_REG_IRQ_MASK_A, 0xff, 0xff, 0xff, 0xff }; 51 51 static u8 da9210_irq_clr[] = { DA9210_REG_MASK_A, 0xff, 0xff }; 52 52 53 - static struct i2c_msg da9xxx_msgs[2] = { 53 + static struct i2c_msg da9xxx_msgs[3] = { 54 54 { 55 55 .addr = 0x58, 56 56 .len = ARRAY_SIZE(da9063_irq_clr), 57 57 .buf = da9063_irq_clr, 58 58 }, { 59 59 .addr = 0x68, 60 + .len = ARRAY_SIZE(da9210_irq_clr), 61 + .buf = da9210_irq_clr, 62 + }, { 63 + .addr = 0x70, 60 64 .len = ARRAY_SIZE(da9210_irq_clr), 61 65 .buf = da9210_irq_clr, 62 66 }, ··· 89 85 dev_dbg(dev, "Detected %s\n", client->name); 90 86 91 87 if ((client->addr == 0x58 && !strcmp(client->name, "da9063")) || 92 - (client->addr == 0x68 && !strcmp(client->name, "da9210"))) { 93 - int ret; 88 + (client->addr == 0x68 && !strcmp(client->name, "da9210")) || 89 + (client->addr == 0x70 && !strcmp(client->name, "da9210"))) { 90 + int ret, len; 91 + 92 + /* There are two DA9210 on Stout, one on the other boards. */ 93 + len = of_machine_is_compatible("renesas,stout") ? 3 : 2; 94 94 95 95 dev_info(&client->dev, "clearing da9063/da9210 interrupts\n"); 96 - ret = i2c_transfer(client->adapter, da9xxx_msgs, ARRAY_SIZE(da9xxx_msgs)); 97 - if (ret != ARRAY_SIZE(da9xxx_msgs)) 96 + ret = i2c_transfer(client->adapter, da9xxx_msgs, len); 97 + if (ret != len) 98 98 dev_err(&client->dev, "i2c error %d\n", ret); 99 99 } 100 100 ··· 126 118 127 119 if (!of_machine_is_compatible("renesas,koelsch") && 128 120 !of_machine_is_compatible("renesas,lager") && 121 + !of_machine_is_compatible("renesas,stout") && 129 122 !of_machine_is_compatible("renesas,gose")) 130 123 return -ENODEV; 131 124
-1
arch/arm/mach-socfpga/pm.c
··· 116 116 static int socfpga_pm_enter(suspend_state_t state) 117 117 { 118 118 switch (state) { 119 - case PM_SUSPEND_STANDBY: 120 119 case PM_SUSPEND_MEM: 121 120 outer_disable(); 122 121 cpu_suspend(0, socfpga_pm_suspend);
+34 -12
arch/arm/mach-stm32/Kconfig
··· 1 - config ARCH_STM32 2 - bool "STMicrolectronics STM32" 3 - depends on ARM_SINGLE_ARMV7M 1 + menuconfig ARCH_STM32 2 + bool "STMicroelectronics STM32 family" if ARM_SINGLE_ARMV7M || ARCH_MULTI_V7 3 + select ARMV7M_SYSTICK if ARM_SINGLE_ARMV7M 4 + select HAVE_ARM_ARCH_TIMER if ARCH_MULTI_V7 5 + select ARM_GIC if ARCH_MULTI_V7 6 + select ARM_PSCI if ARCH_MULTI_V7 4 7 select ARCH_HAS_RESET_CONTROLLER 5 - select ARMV7M_SYSTICK 6 8 select CLKSRC_STM32 7 9 select PINCTRL 8 10 select RESET_CONTROLLER ··· 12 10 help 13 11 Support for STMicroelectronics STM32 processors. 14 12 13 + if ARCH_STM32 14 + 15 + if ARM_SINGLE_ARMV7M 16 + 15 17 config MACH_STM32F429 16 - bool "STMicrolectronics STM32F429" 17 - depends on ARCH_STM32 18 + bool "STMicroelectronics STM32F429" 19 + select ARM_AMBA 18 20 default y 19 21 20 22 config MACH_STM32F469 21 - bool "STMicrolectronics STM32F469" 22 - depends on ARCH_STM32 23 + bool "STMicroelectronics STM32F469" 24 + select ARM_AMBA 23 25 default y 24 26 25 27 config MACH_STM32F746 26 - bool "STMicrolectronics STM32F746" 27 - depends on ARCH_STM32 28 + bool "STMicroelectronics STM32F746" 29 + select ARM_AMBA 30 + default y 31 + 32 + config MACH_STM32F769 33 + bool "STMicroelectronics STM32F769" 34 + select ARM_AMBA 28 35 default y 29 36 30 37 config MACH_STM32H743 31 - bool "STMicrolectronics STM32H743" 32 - depends on ARCH_STM32 38 + bool "STMicroelectronics STM32H743" 33 39 default y 40 + 41 + endif # ARMv7-M 42 + 43 + if ARCH_MULTI_V7 44 + 45 + config MACH_STM32MP157 46 + bool "STMicroelectronics STM32MP157" 47 + default y 48 + 49 + endif # ARMv7-A 50 + 51 + endif
+9 -2
arch/arm/mach-stm32/board-dt.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 1 2 /* 2 3 * Copyright (C) Maxime Coquelin 2015 4 + * Copyright (C) STMicroelectronics 2017 3 5 * Author: Maxime Coquelin <mcoquelin.stm32@gmail.com> 4 - * License terms: GNU General Public License (GPL), version 2 5 6 */ 6 7 7 8 #include <linux/kernel.h> 8 - #include <asm/v7m.h> 9 9 #include <asm/mach/arch.h> 10 + #ifdef CONFIG_ARM_SINGLE_ARMV7M 11 + #include <asm/v7m.h> 12 + #endif 10 13 11 14 static const char *const stm32_compat[] __initconst = { 12 15 "st,stm32f429", 13 16 "st,stm32f469", 14 17 "st,stm32f746", 18 + "st,stm32f769", 15 19 "st,stm32h743", 20 + "st,stm32mp157", 16 21 NULL 17 22 }; 18 23 19 24 DT_MACHINE_START(STM32DT, "STM32 (Device Tree Support)") 20 25 .dt_compat = stm32_compat, 26 + #ifdef CONFIG_ARM_SINGLE_ARMV7M 21 27 .restart = armv7m_restart, 28 + #endif 22 29 MACHINE_END
+7
arch/arm/mach-sunxi/Kconfig
··· 48 48 default ARCH_SUNXI 49 49 select ARM_GIC 50 50 51 + config ARCH_SUNXI_MC_SMP 52 + bool 53 + depends on SMP 54 + default MACH_SUN9I 55 + select ARM_CCI400_PORT_CTRL 56 + select ARM_CPU_SUSPEND 57 + 51 58 endif
+3
arch/arm/mach-sunxi/Makefile
··· 1 + CFLAGS_mc_smp.o += -march=armv7-a 2 + 1 3 obj-$(CONFIG_ARCH_SUNXI) += sunxi.o 4 + obj-$(CONFIG_ARCH_SUNXI_MC_SMP) += mc_smp.o 2 5 obj-$(CONFIG_SMP) += platsmp.o
+856
arch/arm/mach-sunxi/mc_smp.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Copyright (c) 2018 Chen-Yu Tsai 4 + * 5 + * Chen-Yu Tsai <wens@csie.org> 6 + * 7 + * arch/arm/mach-sunxi/mc_smp.c 8 + * 9 + * Based on Allwinner code, arch/arm/mach-exynos/mcpm-exynos.c, and 10 + * arch/arm/mach-hisi/platmcpm.c 11 + * Cluster cache enable trampoline code adapted from MCPM framework 12 + */ 13 + 14 + #include <linux/arm-cci.h> 15 + #include <linux/cpu_pm.h> 16 + #include <linux/delay.h> 17 + #include <linux/io.h> 18 + #include <linux/iopoll.h> 19 + #include <linux/irqchip/arm-gic.h> 20 + #include <linux/of.h> 21 + #include <linux/of_address.h> 22 + #include <linux/of_device.h> 23 + #include <linux/smp.h> 24 + 25 + #include <asm/cacheflush.h> 26 + #include <asm/cp15.h> 27 + #include <asm/cputype.h> 28 + #include <asm/idmap.h> 29 + #include <asm/smp_plat.h> 30 + #include <asm/suspend.h> 31 + 32 + #define SUNXI_CPUS_PER_CLUSTER 4 33 + #define SUNXI_NR_CLUSTERS 2 34 + 35 + #define POLL_USEC 100 36 + #define TIMEOUT_USEC 100000 37 + 38 + #define CPUCFG_CX_CTRL_REG0(c) (0x10 * (c)) 39 + #define CPUCFG_CX_CTRL_REG0_L1_RST_DISABLE(n) BIT(n) 40 + #define CPUCFG_CX_CTRL_REG0_L1_RST_DISABLE_ALL 0xf 41 + #define CPUCFG_CX_CTRL_REG0_L2_RST_DISABLE_A7 BIT(4) 42 + #define CPUCFG_CX_CTRL_REG0_L2_RST_DISABLE_A15 BIT(0) 43 + #define CPUCFG_CX_CTRL_REG1(c) (0x10 * (c) + 0x4) 44 + #define CPUCFG_CX_CTRL_REG1_ACINACTM BIT(0) 45 + #define CPUCFG_CX_STATUS(c) (0x30 + 0x4 * (c)) 46 + #define CPUCFG_CX_STATUS_STANDBYWFI(n) BIT(16 + (n)) 47 + #define CPUCFG_CX_STATUS_STANDBYWFIL2 BIT(0) 48 + #define CPUCFG_CX_RST_CTRL(c) (0x80 + 0x4 * (c)) 49 + #define CPUCFG_CX_RST_CTRL_DBG_SOC_RST BIT(24) 50 + #define CPUCFG_CX_RST_CTRL_ETM_RST(n) BIT(20 + (n)) 51 + #define CPUCFG_CX_RST_CTRL_ETM_RST_ALL (0xf << 20) 52 + #define CPUCFG_CX_RST_CTRL_DBG_RST(n) BIT(16 + (n)) 53 + #define CPUCFG_CX_RST_CTRL_DBG_RST_ALL (0xf << 16) 54 + #define CPUCFG_CX_RST_CTRL_H_RST BIT(12) 55 + #define CPUCFG_CX_RST_CTRL_L2_RST BIT(8) 56 + #define CPUCFG_CX_RST_CTRL_CX_RST(n) BIT(4 + (n)) 57 + #define CPUCFG_CX_RST_CTRL_CORE_RST(n) BIT(n) 58 + 59 + #define PRCM_CPU_PO_RST_CTRL(c) (0x4 + 0x4 * (c)) 60 + #define PRCM_CPU_PO_RST_CTRL_CORE(n) BIT(n) 61 + #define PRCM_CPU_PO_RST_CTRL_CORE_ALL 0xf 62 + #define PRCM_PWROFF_GATING_REG(c) (0x100 + 0x4 * (c)) 63 + #define PRCM_PWROFF_GATING_REG_CLUSTER BIT(4) 64 + #define PRCM_PWROFF_GATING_REG_CORE(n) BIT(n) 65 + #define PRCM_PWR_SWITCH_REG(c, cpu) (0x140 + 0x10 * (c) + 0x4 * (cpu)) 66 + #define PRCM_CPU_SOFT_ENTRY_REG 0x164 67 + 68 + #define CPU0_SUPPORT_HOTPLUG_MAGIC0 0xFA50392F 69 + #define CPU0_SUPPORT_HOTPLUG_MAGIC1 0x790DCA3A 70 + 71 + static void __iomem *cpucfg_base; 72 + static void __iomem *prcm_base; 73 + static void __iomem *sram_b_smp_base; 74 + 75 + static bool sunxi_core_is_cortex_a15(unsigned int core, unsigned int cluster) 76 + { 77 + struct device_node *node; 78 + int cpu = cluster * SUNXI_CPUS_PER_CLUSTER + core; 79 + 80 + node = of_cpu_device_node_get(cpu); 81 + 82 + /* In case of_cpu_device_node_get fails */ 83 + if (!node) 84 + node = of_get_cpu_node(cpu, NULL); 85 + 86 + if (!node) { 87 + /* 88 + * There's no point in returning an error, since we 89 + * would be mid way in a core or cluster power sequence. 90 + */ 91 + pr_err("%s: Couldn't get CPU cluster %u core %u device node\n", 92 + __func__, cluster, core); 93 + 94 + return false; 95 + } 96 + 97 + return of_device_is_compatible(node, "arm,cortex-a15"); 98 + } 99 + 100 + static int sunxi_cpu_power_switch_set(unsigned int cpu, unsigned int cluster, 101 + bool enable) 102 + { 103 + u32 reg; 104 + 105 + /* control sequence from Allwinner A80 user manual v1.2 PRCM section */ 106 + reg = readl(prcm_base + PRCM_PWR_SWITCH_REG(cluster, cpu)); 107 + if (enable) { 108 + if (reg == 0x00) { 109 + pr_debug("power clamp for cluster %u cpu %u already open\n", 110 + cluster, cpu); 111 + return 0; 112 + } 113 + 114 + writel(0xff, prcm_base + PRCM_PWR_SWITCH_REG(cluster, cpu)); 115 + udelay(10); 116 + writel(0xfe, prcm_base + PRCM_PWR_SWITCH_REG(cluster, cpu)); 117 + udelay(10); 118 + writel(0xf8, prcm_base + PRCM_PWR_SWITCH_REG(cluster, cpu)); 119 + udelay(10); 120 + writel(0xf0, prcm_base + PRCM_PWR_SWITCH_REG(cluster, cpu)); 121 + udelay(10); 122 + writel(0x00, prcm_base + PRCM_PWR_SWITCH_REG(cluster, cpu)); 123 + udelay(10); 124 + } else { 125 + writel(0xff, prcm_base + PRCM_PWR_SWITCH_REG(cluster, cpu)); 126 + udelay(10); 127 + } 128 + 129 + return 0; 130 + } 131 + 132 + static void sunxi_cpu0_hotplug_support_set(bool enable) 133 + { 134 + if (enable) { 135 + writel(CPU0_SUPPORT_HOTPLUG_MAGIC0, sram_b_smp_base); 136 + writel(CPU0_SUPPORT_HOTPLUG_MAGIC1, sram_b_smp_base + 0x4); 137 + } else { 138 + writel(0x0, sram_b_smp_base); 139 + writel(0x0, sram_b_smp_base + 0x4); 140 + } 141 + } 142 + 143 + static int sunxi_cpu_powerup(unsigned int cpu, unsigned int cluster) 144 + { 145 + u32 reg; 146 + 147 + pr_debug("%s: cluster %u cpu %u\n", __func__, cluster, cpu); 148 + if (cpu >= SUNXI_CPUS_PER_CLUSTER || cluster >= SUNXI_NR_CLUSTERS) 149 + return -EINVAL; 150 + 151 + /* Set hotplug support magic flags for cpu0 */ 152 + if (cluster == 0 && cpu == 0) 153 + sunxi_cpu0_hotplug_support_set(true); 154 + 155 + /* assert processor power-on reset */ 156 + reg = readl(prcm_base + PRCM_CPU_PO_RST_CTRL(cluster)); 157 + reg &= ~PRCM_CPU_PO_RST_CTRL_CORE(cpu); 158 + writel(reg, prcm_base + PRCM_CPU_PO_RST_CTRL(cluster)); 159 + 160 + /* Cortex-A7: hold L1 reset disable signal low */ 161 + if (!sunxi_core_is_cortex_a15(cpu, cluster)) { 162 + reg = readl(cpucfg_base + CPUCFG_CX_CTRL_REG0(cluster)); 163 + reg &= ~CPUCFG_CX_CTRL_REG0_L1_RST_DISABLE(cpu); 164 + writel(reg, cpucfg_base + CPUCFG_CX_CTRL_REG0(cluster)); 165 + } 166 + 167 + /* assert processor related resets */ 168 + reg = readl(cpucfg_base + CPUCFG_CX_RST_CTRL(cluster)); 169 + reg &= ~CPUCFG_CX_RST_CTRL_DBG_RST(cpu); 170 + 171 + /* 172 + * Allwinner code also asserts resets for NEON on A15. According 173 + * to ARM manuals, asserting power-on reset is sufficient. 174 + */ 175 + if (!sunxi_core_is_cortex_a15(cpu, cluster)) 176 + reg &= ~CPUCFG_CX_RST_CTRL_ETM_RST(cpu); 177 + 178 + writel(reg, cpucfg_base + CPUCFG_CX_RST_CTRL(cluster)); 179 + 180 + /* open power switch */ 181 + sunxi_cpu_power_switch_set(cpu, cluster, true); 182 + 183 + /* clear processor power gate */ 184 + reg = readl(prcm_base + PRCM_PWROFF_GATING_REG(cluster)); 185 + reg &= ~PRCM_PWROFF_GATING_REG_CORE(cpu); 186 + writel(reg, prcm_base + PRCM_PWROFF_GATING_REG(cluster)); 187 + udelay(20); 188 + 189 + /* de-assert processor power-on reset */ 190 + reg = readl(prcm_base + PRCM_CPU_PO_RST_CTRL(cluster)); 191 + reg |= PRCM_CPU_PO_RST_CTRL_CORE(cpu); 192 + writel(reg, prcm_base + PRCM_CPU_PO_RST_CTRL(cluster)); 193 + 194 + /* de-assert all processor resets */ 195 + reg = readl(cpucfg_base + CPUCFG_CX_RST_CTRL(cluster)); 196 + reg |= CPUCFG_CX_RST_CTRL_DBG_RST(cpu); 197 + reg |= CPUCFG_CX_RST_CTRL_CORE_RST(cpu); 198 + if (!sunxi_core_is_cortex_a15(cpu, cluster)) 199 + reg |= CPUCFG_CX_RST_CTRL_ETM_RST(cpu); 200 + else 201 + reg |= CPUCFG_CX_RST_CTRL_CX_RST(cpu); /* NEON */ 202 + writel(reg, cpucfg_base + CPUCFG_CX_RST_CTRL(cluster)); 203 + 204 + return 0; 205 + } 206 + 207 + static int sunxi_cluster_powerup(unsigned int cluster) 208 + { 209 + u32 reg; 210 + 211 + pr_debug("%s: cluster %u\n", __func__, cluster); 212 + if (cluster >= SUNXI_NR_CLUSTERS) 213 + return -EINVAL; 214 + 215 + /* assert ACINACTM */ 216 + reg = readl(cpucfg_base + CPUCFG_CX_CTRL_REG1(cluster)); 217 + reg |= CPUCFG_CX_CTRL_REG1_ACINACTM; 218 + writel(reg, cpucfg_base + CPUCFG_CX_CTRL_REG1(cluster)); 219 + 220 + /* assert cluster processor power-on resets */ 221 + reg = readl(prcm_base + PRCM_CPU_PO_RST_CTRL(cluster)); 222 + reg &= ~PRCM_CPU_PO_RST_CTRL_CORE_ALL; 223 + writel(reg, prcm_base + PRCM_CPU_PO_RST_CTRL(cluster)); 224 + 225 + /* assert cluster resets */ 226 + reg = readl(cpucfg_base + CPUCFG_CX_RST_CTRL(cluster)); 227 + reg &= ~CPUCFG_CX_RST_CTRL_DBG_SOC_RST; 228 + reg &= ~CPUCFG_CX_RST_CTRL_DBG_RST_ALL; 229 + reg &= ~CPUCFG_CX_RST_CTRL_H_RST; 230 + reg &= ~CPUCFG_CX_RST_CTRL_L2_RST; 231 + 232 + /* 233 + * Allwinner code also asserts resets for NEON on A15. According 234 + * to ARM manuals, asserting power-on reset is sufficient. 235 + */ 236 + if (!sunxi_core_is_cortex_a15(0, cluster)) 237 + reg &= ~CPUCFG_CX_RST_CTRL_ETM_RST_ALL; 238 + 239 + writel(reg, cpucfg_base + CPUCFG_CX_RST_CTRL(cluster)); 240 + 241 + /* hold L1/L2 reset disable signals low */ 242 + reg = readl(cpucfg_base + CPUCFG_CX_CTRL_REG0(cluster)); 243 + if (sunxi_core_is_cortex_a15(0, cluster)) { 244 + /* Cortex-A15: hold L2RSTDISABLE low */ 245 + reg &= ~CPUCFG_CX_CTRL_REG0_L2_RST_DISABLE_A15; 246 + } else { 247 + /* Cortex-A7: hold L1RSTDISABLE and L2RSTDISABLE low */ 248 + reg &= ~CPUCFG_CX_CTRL_REG0_L1_RST_DISABLE_ALL; 249 + reg &= ~CPUCFG_CX_CTRL_REG0_L2_RST_DISABLE_A7; 250 + } 251 + writel(reg, cpucfg_base + CPUCFG_CX_CTRL_REG0(cluster)); 252 + 253 + /* clear cluster power gate */ 254 + reg = readl(prcm_base + PRCM_PWROFF_GATING_REG(cluster)); 255 + reg &= ~PRCM_PWROFF_GATING_REG_CLUSTER; 256 + writel(reg, prcm_base + PRCM_PWROFF_GATING_REG(cluster)); 257 + udelay(20); 258 + 259 + /* de-assert cluster resets */ 260 + reg = readl(cpucfg_base + CPUCFG_CX_RST_CTRL(cluster)); 261 + reg |= CPUCFG_CX_RST_CTRL_DBG_SOC_RST; 262 + reg |= CPUCFG_CX_RST_CTRL_H_RST; 263 + reg |= CPUCFG_CX_RST_CTRL_L2_RST; 264 + writel(reg, cpucfg_base + CPUCFG_CX_RST_CTRL(cluster)); 265 + 266 + /* de-assert ACINACTM */ 267 + reg = readl(cpucfg_base + CPUCFG_CX_CTRL_REG1(cluster)); 268 + reg &= ~CPUCFG_CX_CTRL_REG1_ACINACTM; 269 + writel(reg, cpucfg_base + CPUCFG_CX_CTRL_REG1(cluster)); 270 + 271 + return 0; 272 + } 273 + 274 + /* 275 + * This bit is shared between the initial nocache_trampoline call to 276 + * enable CCI-400 and proper cluster cache disable before power down. 277 + */ 278 + static void sunxi_cluster_cache_disable_without_axi(void) 279 + { 280 + if (read_cpuid_part() == ARM_CPU_PART_CORTEX_A15) { 281 + /* 282 + * On the Cortex-A15 we need to disable 283 + * L2 prefetching before flushing the cache. 284 + */ 285 + asm volatile( 286 + "mcr p15, 1, %0, c15, c0, 3\n" 287 + "isb\n" 288 + "dsb" 289 + : : "r" (0x400)); 290 + } 291 + 292 + /* Flush all cache levels for this cluster. */ 293 + v7_exit_coherency_flush(all); 294 + 295 + /* 296 + * Disable cluster-level coherency by masking 297 + * incoming snoops and DVM messages: 298 + */ 299 + cci_disable_port_by_cpu(read_cpuid_mpidr()); 300 + } 301 + 302 + static int sunxi_mc_smp_cpu_table[SUNXI_NR_CLUSTERS][SUNXI_CPUS_PER_CLUSTER]; 303 + static int sunxi_mc_smp_first_comer; 304 + 305 + /* 306 + * Enable cluster-level coherency, in preparation for turning on the MMU. 307 + * 308 + * Also enable regional clock gating and L2 data latency settings for 309 + * Cortex-A15. These settings are from the vendor kernel. 310 + */ 311 + static void __naked sunxi_mc_smp_cluster_cache_enable(void) 312 + { 313 + asm volatile ( 314 + "mrc p15, 0, r1, c0, c0, 0\n" 315 + "movw r2, #" __stringify(ARM_CPU_PART_MASK & 0xffff) "\n" 316 + "movt r2, #" __stringify(ARM_CPU_PART_MASK >> 16) "\n" 317 + "and r1, r1, r2\n" 318 + "movw r2, #" __stringify(ARM_CPU_PART_CORTEX_A15 & 0xffff) "\n" 319 + "movt r2, #" __stringify(ARM_CPU_PART_CORTEX_A15 >> 16) "\n" 320 + "cmp r1, r2\n" 321 + "bne not_a15\n" 322 + 323 + /* The following is Cortex-A15 specific */ 324 + 325 + /* ACTLR2: Enable CPU regional clock gates */ 326 + "mrc p15, 1, r1, c15, c0, 4\n" 327 + "orr r1, r1, #(0x1<<31)\n" 328 + "mcr p15, 1, r1, c15, c0, 4\n" 329 + 330 + /* L2ACTLR */ 331 + "mrc p15, 1, r1, c15, c0, 0\n" 332 + /* Enable L2, GIC, and Timer regional clock gates */ 333 + "orr r1, r1, #(0x1<<26)\n" 334 + /* Disable clean/evict from being pushed to external */ 335 + "orr r1, r1, #(0x1<<3)\n" 336 + "mcr p15, 1, r1, c15, c0, 0\n" 337 + 338 + /* L2CTRL: L2 data RAM latency */ 339 + "mrc p15, 1, r1, c9, c0, 2\n" 340 + "bic r1, r1, #(0x7<<0)\n" 341 + "orr r1, r1, #(0x3<<0)\n" 342 + "mcr p15, 1, r1, c9, c0, 2\n" 343 + 344 + /* End of Cortex-A15 specific setup */ 345 + "not_a15:\n" 346 + 347 + /* Get value of sunxi_mc_smp_first_comer */ 348 + "adr r1, first\n" 349 + "ldr r0, [r1]\n" 350 + "ldr r0, [r1, r0]\n" 351 + 352 + /* Skip cci_enable_port_for_self if not first comer */ 353 + "cmp r0, #0\n" 354 + "bxeq lr\n" 355 + "b cci_enable_port_for_self\n" 356 + 357 + ".align 2\n" 358 + "first: .word sunxi_mc_smp_first_comer - .\n" 359 + ); 360 + } 361 + 362 + static void __naked sunxi_mc_smp_secondary_startup(void) 363 + { 364 + asm volatile( 365 + "bl sunxi_mc_smp_cluster_cache_enable\n" 366 + "b secondary_startup" 367 + /* Let compiler know about sunxi_mc_smp_cluster_cache_enable */ 368 + :: "i" (sunxi_mc_smp_cluster_cache_enable) 369 + ); 370 + } 371 + 372 + static DEFINE_SPINLOCK(boot_lock); 373 + 374 + static bool sunxi_mc_smp_cluster_is_down(unsigned int cluster) 375 + { 376 + int i; 377 + 378 + for (i = 0; i < SUNXI_CPUS_PER_CLUSTER; i++) 379 + if (sunxi_mc_smp_cpu_table[cluster][i]) 380 + return false; 381 + return true; 382 + } 383 + 384 + static void sunxi_mc_smp_secondary_init(unsigned int cpu) 385 + { 386 + /* Clear hotplug support magic flags for cpu0 */ 387 + if (cpu == 0) 388 + sunxi_cpu0_hotplug_support_set(false); 389 + } 390 + 391 + static int sunxi_mc_smp_boot_secondary(unsigned int l_cpu, struct task_struct *idle) 392 + { 393 + unsigned int mpidr, cpu, cluster; 394 + 395 + mpidr = cpu_logical_map(l_cpu); 396 + cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); 397 + cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); 398 + 399 + if (!cpucfg_base) 400 + return -ENODEV; 401 + if (cluster >= SUNXI_NR_CLUSTERS || cpu >= SUNXI_CPUS_PER_CLUSTER) 402 + return -EINVAL; 403 + 404 + spin_lock_irq(&boot_lock); 405 + 406 + if (sunxi_mc_smp_cpu_table[cluster][cpu]) 407 + goto out; 408 + 409 + if (sunxi_mc_smp_cluster_is_down(cluster)) { 410 + sunxi_mc_smp_first_comer = true; 411 + sunxi_cluster_powerup(cluster); 412 + } else { 413 + sunxi_mc_smp_first_comer = false; 414 + } 415 + 416 + /* This is read by incoming CPUs with their cache and MMU disabled */ 417 + sync_cache_w(&sunxi_mc_smp_first_comer); 418 + sunxi_cpu_powerup(cpu, cluster); 419 + 420 + out: 421 + sunxi_mc_smp_cpu_table[cluster][cpu]++; 422 + spin_unlock_irq(&boot_lock); 423 + 424 + return 0; 425 + } 426 + 427 + #ifdef CONFIG_HOTPLUG_CPU 428 + static void sunxi_cluster_cache_disable(void) 429 + { 430 + unsigned int cluster = MPIDR_AFFINITY_LEVEL(read_cpuid_mpidr(), 1); 431 + u32 reg; 432 + 433 + pr_debug("%s: cluster %u\n", __func__, cluster); 434 + 435 + sunxi_cluster_cache_disable_without_axi(); 436 + 437 + /* last man standing, assert ACINACTM */ 438 + reg = readl(cpucfg_base + CPUCFG_CX_CTRL_REG1(cluster)); 439 + reg |= CPUCFG_CX_CTRL_REG1_ACINACTM; 440 + writel(reg, cpucfg_base + CPUCFG_CX_CTRL_REG1(cluster)); 441 + } 442 + 443 + static void sunxi_mc_smp_cpu_die(unsigned int l_cpu) 444 + { 445 + unsigned int mpidr, cpu, cluster; 446 + bool last_man; 447 + 448 + mpidr = cpu_logical_map(l_cpu); 449 + cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); 450 + cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); 451 + pr_debug("%s: cluster %u cpu %u\n", __func__, cluster, cpu); 452 + 453 + spin_lock(&boot_lock); 454 + sunxi_mc_smp_cpu_table[cluster][cpu]--; 455 + if (sunxi_mc_smp_cpu_table[cluster][cpu] == 1) { 456 + /* A power_up request went ahead of us. */ 457 + pr_debug("%s: aborting due to a power up request\n", 458 + __func__); 459 + spin_unlock(&boot_lock); 460 + return; 461 + } else if (sunxi_mc_smp_cpu_table[cluster][cpu] > 1) { 462 + pr_err("Cluster %d CPU%d boots multiple times\n", 463 + cluster, cpu); 464 + BUG(); 465 + } 466 + 467 + last_man = sunxi_mc_smp_cluster_is_down(cluster); 468 + spin_unlock(&boot_lock); 469 + 470 + gic_cpu_if_down(0); 471 + if (last_man) 472 + sunxi_cluster_cache_disable(); 473 + else 474 + v7_exit_coherency_flush(louis); 475 + 476 + for (;;) 477 + wfi(); 478 + } 479 + 480 + static int sunxi_cpu_powerdown(unsigned int cpu, unsigned int cluster) 481 + { 482 + u32 reg; 483 + 484 + pr_debug("%s: cluster %u cpu %u\n", __func__, cluster, cpu); 485 + if (cpu >= SUNXI_CPUS_PER_CLUSTER || cluster >= SUNXI_NR_CLUSTERS) 486 + return -EINVAL; 487 + 488 + /* gate processor power */ 489 + reg = readl(prcm_base + PRCM_PWROFF_GATING_REG(cluster)); 490 + reg |= PRCM_PWROFF_GATING_REG_CORE(cpu); 491 + writel(reg, prcm_base + PRCM_PWROFF_GATING_REG(cluster)); 492 + udelay(20); 493 + 494 + /* close power switch */ 495 + sunxi_cpu_power_switch_set(cpu, cluster, false); 496 + 497 + return 0; 498 + } 499 + 500 + static int sunxi_cluster_powerdown(unsigned int cluster) 501 + { 502 + u32 reg; 503 + 504 + pr_debug("%s: cluster %u\n", __func__, cluster); 505 + if (cluster >= SUNXI_NR_CLUSTERS) 506 + return -EINVAL; 507 + 508 + /* assert cluster resets or system will hang */ 509 + pr_debug("%s: assert cluster reset\n", __func__); 510 + reg = readl(cpucfg_base + CPUCFG_CX_RST_CTRL(cluster)); 511 + reg &= ~CPUCFG_CX_RST_CTRL_DBG_SOC_RST; 512 + reg &= ~CPUCFG_CX_RST_CTRL_H_RST; 513 + reg &= ~CPUCFG_CX_RST_CTRL_L2_RST; 514 + writel(reg, cpucfg_base + CPUCFG_CX_RST_CTRL(cluster)); 515 + 516 + /* gate cluster power */ 517 + pr_debug("%s: gate cluster power\n", __func__); 518 + reg = readl(prcm_base + PRCM_PWROFF_GATING_REG(cluster)); 519 + reg |= PRCM_PWROFF_GATING_REG_CLUSTER; 520 + writel(reg, prcm_base + PRCM_PWROFF_GATING_REG(cluster)); 521 + udelay(20); 522 + 523 + return 0; 524 + } 525 + 526 + static int sunxi_mc_smp_cpu_kill(unsigned int l_cpu) 527 + { 528 + unsigned int mpidr, cpu, cluster; 529 + unsigned int tries, count; 530 + int ret = 0; 531 + u32 reg; 532 + 533 + mpidr = cpu_logical_map(l_cpu); 534 + cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); 535 + cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); 536 + 537 + /* This should never happen */ 538 + if (WARN_ON(cluster >= SUNXI_NR_CLUSTERS || 539 + cpu >= SUNXI_CPUS_PER_CLUSTER)) 540 + return 0; 541 + 542 + /* wait for CPU core to die and enter WFI */ 543 + count = TIMEOUT_USEC / POLL_USEC; 544 + spin_lock_irq(&boot_lock); 545 + for (tries = 0; tries < count; tries++) { 546 + spin_unlock_irq(&boot_lock); 547 + usleep_range(POLL_USEC / 2, POLL_USEC); 548 + spin_lock_irq(&boot_lock); 549 + 550 + /* 551 + * If the user turns off a bunch of cores at the same 552 + * time, the kernel might call cpu_kill before some of 553 + * them are ready. This is because boot_lock serializes 554 + * both cpu_die and cpu_kill callbacks. Either one could 555 + * run first. We should wait for cpu_die to complete. 556 + */ 557 + if (sunxi_mc_smp_cpu_table[cluster][cpu]) 558 + continue; 559 + 560 + reg = readl(cpucfg_base + CPUCFG_CX_STATUS(cluster)); 561 + if (reg & CPUCFG_CX_STATUS_STANDBYWFI(cpu)) 562 + break; 563 + } 564 + 565 + if (tries >= count) { 566 + ret = ETIMEDOUT; 567 + goto out; 568 + } 569 + 570 + /* power down CPU core */ 571 + sunxi_cpu_powerdown(cpu, cluster); 572 + 573 + if (!sunxi_mc_smp_cluster_is_down(cluster)) 574 + goto out; 575 + 576 + /* wait for cluster L2 WFI */ 577 + ret = readl_poll_timeout(cpucfg_base + CPUCFG_CX_STATUS(cluster), reg, 578 + reg & CPUCFG_CX_STATUS_STANDBYWFIL2, 579 + POLL_USEC, TIMEOUT_USEC); 580 + if (ret) { 581 + /* 582 + * Ignore timeout on the cluster. Leaving the cluster on 583 + * will not affect system execution, just use a bit more 584 + * power. But returning an error here will only confuse 585 + * the user as the CPU has already been shutdown. 586 + */ 587 + ret = 0; 588 + goto out; 589 + } 590 + 591 + /* Power down cluster */ 592 + sunxi_cluster_powerdown(cluster); 593 + 594 + out: 595 + spin_unlock_irq(&boot_lock); 596 + pr_debug("%s: cluster %u cpu %u powerdown: %d\n", 597 + __func__, cluster, cpu, ret); 598 + return !ret; 599 + } 600 + 601 + static bool sunxi_mc_smp_cpu_can_disable(unsigned int __unused) 602 + { 603 + return true; 604 + } 605 + #endif 606 + 607 + static const struct smp_operations sunxi_mc_smp_smp_ops __initconst = { 608 + .smp_secondary_init = sunxi_mc_smp_secondary_init, 609 + .smp_boot_secondary = sunxi_mc_smp_boot_secondary, 610 + #ifdef CONFIG_HOTPLUG_CPU 611 + .cpu_die = sunxi_mc_smp_cpu_die, 612 + .cpu_kill = sunxi_mc_smp_cpu_kill, 613 + .cpu_can_disable = sunxi_mc_smp_cpu_can_disable, 614 + #endif 615 + }; 616 + 617 + static bool __init sunxi_mc_smp_cpu_table_init(void) 618 + { 619 + unsigned int mpidr, cpu, cluster; 620 + 621 + mpidr = read_cpuid_mpidr(); 622 + cpu = MPIDR_AFFINITY_LEVEL(mpidr, 0); 623 + cluster = MPIDR_AFFINITY_LEVEL(mpidr, 1); 624 + 625 + if (cluster >= SUNXI_NR_CLUSTERS || cpu >= SUNXI_CPUS_PER_CLUSTER) { 626 + pr_err("%s: boot CPU is out of bounds!\n", __func__); 627 + return false; 628 + } 629 + sunxi_mc_smp_cpu_table[cluster][cpu] = 1; 630 + return true; 631 + } 632 + 633 + /* 634 + * Adapted from arch/arm/common/mc_smp_entry.c 635 + * 636 + * We need the trampoline code to enable CCI-400 on the first cluster 637 + */ 638 + typedef typeof(cpu_reset) phys_reset_t; 639 + 640 + static void __init __naked sunxi_mc_smp_resume(void) 641 + { 642 + asm volatile( 643 + "bl sunxi_mc_smp_cluster_cache_enable\n" 644 + "b cpu_resume" 645 + /* Let compiler know about sunxi_mc_smp_cluster_cache_enable */ 646 + :: "i" (sunxi_mc_smp_cluster_cache_enable) 647 + ); 648 + } 649 + 650 + static int __init nocache_trampoline(unsigned long __unused) 651 + { 652 + phys_reset_t phys_reset; 653 + 654 + setup_mm_for_reboot(); 655 + sunxi_cluster_cache_disable_without_axi(); 656 + 657 + phys_reset = (phys_reset_t)(unsigned long)__pa_symbol(cpu_reset); 658 + phys_reset(__pa_symbol(sunxi_mc_smp_resume), false); 659 + BUG(); 660 + } 661 + 662 + static int __init sunxi_mc_smp_loopback(void) 663 + { 664 + int ret; 665 + 666 + /* 667 + * We're going to soft-restart the current CPU through the 668 + * low-level MCPM code by leveraging the suspend/resume 669 + * infrastructure. Let's play it safe by using cpu_pm_enter() 670 + * in case the CPU init code path resets the VFP or similar. 671 + */ 672 + sunxi_mc_smp_first_comer = true; 673 + local_irq_disable(); 674 + local_fiq_disable(); 675 + ret = cpu_pm_enter(); 676 + if (!ret) { 677 + ret = cpu_suspend(0, nocache_trampoline); 678 + cpu_pm_exit(); 679 + } 680 + local_fiq_enable(); 681 + local_irq_enable(); 682 + sunxi_mc_smp_first_comer = false; 683 + 684 + return ret; 685 + } 686 + 687 + /* 688 + * This holds any device nodes that we requested resources for, 689 + * so that we may easily release resources in the error path. 690 + */ 691 + struct sunxi_mc_smp_nodes { 692 + struct device_node *prcm_node; 693 + struct device_node *cpucfg_node; 694 + struct device_node *sram_node; 695 + }; 696 + 697 + /* This structure holds SoC-specific bits tied to an enable-method string. */ 698 + struct sunxi_mc_smp_data { 699 + const char *enable_method; 700 + int (*get_smp_nodes)(struct sunxi_mc_smp_nodes *nodes); 701 + }; 702 + 703 + static void __init sunxi_mc_smp_put_nodes(struct sunxi_mc_smp_nodes *nodes) 704 + { 705 + of_node_put(nodes->prcm_node); 706 + of_node_put(nodes->cpucfg_node); 707 + of_node_put(nodes->sram_node); 708 + memset(nodes, 0, sizeof(*nodes)); 709 + } 710 + 711 + static int __init sun9i_a80_get_smp_nodes(struct sunxi_mc_smp_nodes *nodes) 712 + { 713 + nodes->prcm_node = of_find_compatible_node(NULL, NULL, 714 + "allwinner,sun9i-a80-prcm"); 715 + if (!nodes->prcm_node) { 716 + pr_err("%s: PRCM not available\n", __func__); 717 + return -ENODEV; 718 + } 719 + 720 + nodes->cpucfg_node = of_find_compatible_node(NULL, NULL, 721 + "allwinner,sun9i-a80-cpucfg"); 722 + if (!nodes->cpucfg_node) { 723 + pr_err("%s: CPUCFG not available\n", __func__); 724 + return -ENODEV; 725 + } 726 + 727 + nodes->sram_node = of_find_compatible_node(NULL, NULL, 728 + "allwinner,sun9i-a80-smp-sram"); 729 + if (!nodes->sram_node) { 730 + pr_err("%s: Secure SRAM not available\n", __func__); 731 + return -ENODEV; 732 + } 733 + 734 + return 0; 735 + } 736 + 737 + static const struct sunxi_mc_smp_data sunxi_mc_smp_data[] __initconst = { 738 + { 739 + .enable_method = "allwinner,sun9i-a80-smp", 740 + .get_smp_nodes = sun9i_a80_get_smp_nodes, 741 + }, 742 + }; 743 + 744 + static int __init sunxi_mc_smp_init(void) 745 + { 746 + struct sunxi_mc_smp_nodes nodes = { 0 }; 747 + struct device_node *node; 748 + struct resource res; 749 + int i, ret; 750 + 751 + /* 752 + * Don't bother checking the "cpus" node, as an enable-method 753 + * property in that node is undocumented. 754 + */ 755 + node = of_cpu_device_node_get(0); 756 + if (!node) 757 + return -ENODEV; 758 + 759 + /* 760 + * We can't actually use the enable-method magic in the kernel. 761 + * Our loopback / trampoline code uses the CPU suspend framework, 762 + * which requires the identity mapping be available. It would not 763 + * yet be available if we used the .init_cpus or .prepare_cpus 764 + * callbacks in smp_operations, which we would use if we were to 765 + * use CPU_METHOD_OF_DECLARE 766 + */ 767 + for (i = 0; i < ARRAY_SIZE(sunxi_mc_smp_data); i++) { 768 + ret = of_property_match_string(node, "enable-method", 769 + sunxi_mc_smp_data[i].enable_method); 770 + if (!ret) 771 + break; 772 + } 773 + 774 + of_node_put(node); 775 + if (ret) 776 + return -ENODEV; 777 + 778 + if (!sunxi_mc_smp_cpu_table_init()) 779 + return -EINVAL; 780 + 781 + if (!cci_probed()) { 782 + pr_err("%s: CCI-400 not available\n", __func__); 783 + return -ENODEV; 784 + } 785 + 786 + /* Get needed device tree nodes */ 787 + ret = sunxi_mc_smp_data[i].get_smp_nodes(&nodes); 788 + if (ret) 789 + goto err_put_nodes; 790 + 791 + /* 792 + * Unfortunately we can not request the I/O region for the PRCM. 793 + * It is shared with the PRCM clock. 794 + */ 795 + prcm_base = of_iomap(nodes.prcm_node, 0); 796 + if (!prcm_base) { 797 + pr_err("%s: failed to map PRCM registers\n", __func__); 798 + ret = -ENOMEM; 799 + goto err_put_nodes; 800 + } 801 + 802 + cpucfg_base = of_io_request_and_map(nodes.cpucfg_node, 0, 803 + "sunxi-mc-smp"); 804 + if (IS_ERR(cpucfg_base)) { 805 + ret = PTR_ERR(cpucfg_base); 806 + pr_err("%s: failed to map CPUCFG registers: %d\n", 807 + __func__, ret); 808 + goto err_unmap_prcm; 809 + } 810 + 811 + sram_b_smp_base = of_io_request_and_map(nodes.sram_node, 0, 812 + "sunxi-mc-smp"); 813 + if (IS_ERR(sram_b_smp_base)) { 814 + ret = PTR_ERR(sram_b_smp_base); 815 + pr_err("%s: failed to map secure SRAM\n", __func__); 816 + goto err_unmap_release_cpucfg; 817 + } 818 + 819 + /* Configure CCI-400 for boot cluster */ 820 + ret = sunxi_mc_smp_loopback(); 821 + if (ret) { 822 + pr_err("%s: failed to configure boot cluster: %d\n", 823 + __func__, ret); 824 + goto err_unmap_release_secure_sram; 825 + } 826 + 827 + /* We don't need the device nodes anymore */ 828 + sunxi_mc_smp_put_nodes(&nodes); 829 + 830 + /* Set the hardware entry point address */ 831 + writel(__pa_symbol(sunxi_mc_smp_secondary_startup), 832 + prcm_base + PRCM_CPU_SOFT_ENTRY_REG); 833 + 834 + /* Actually enable multi cluster SMP */ 835 + smp_set_ops(&sunxi_mc_smp_smp_ops); 836 + 837 + pr_info("sunxi multi cluster SMP support installed\n"); 838 + 839 + return 0; 840 + 841 + err_unmap_release_secure_sram: 842 + iounmap(sram_b_smp_base); 843 + of_address_to_resource(nodes.sram_node, 0, &res); 844 + release_mem_region(res.start, resource_size(&res)); 845 + err_unmap_release_cpucfg: 846 + iounmap(cpucfg_base); 847 + of_address_to_resource(nodes.cpucfg_node, 0, &res); 848 + release_mem_region(res.start, resource_size(&res)); 849 + err_unmap_prcm: 850 + iounmap(prcm_base); 851 + err_put_nodes: 852 + sunxi_mc_smp_put_nodes(&nodes); 853 + return ret; 854 + } 855 + 856 + early_initcall(sunxi_mc_smp_init);
-6
arch/arm/plat-omap/Kconfig
··· 106 106 help 107 107 PPA routine service ID for setting L2 auxiliary control register. 108 108 109 - config OMAP_DM_TIMER 110 - bool "Use dual-mode timer" 111 - depends on ARCH_OMAP16XX || ARCH_OMAP2PLUS 112 - help 113 - Select this option if you want to use OMAP Dual-Mode timers. 114 - 115 109 config OMAP_SERIAL_WAKE 116 110 bool "Enable wake-up events for serial ports" 117 111 depends on ARCH_OMAP1 && OMAP_MUX
-1
arch/arm/plat-omap/Makefile
··· 9 9 10 10 # omap_device support (OMAP2+ only at the moment) 11 11 12 - obj-$(CONFIG_OMAP_DM_TIMER) += dmtimer.o 13 12 obj-$(CONFIG_OMAP_DEBUG_LEDS) += debug-leds.o
+143 -143
arch/arm/plat-omap/dmtimer.c drivers/clocksource/timer-ti-dm.c
··· 47 47 #include <linux/platform_device.h> 48 48 #include <linux/platform_data/dmtimer-omap.h> 49 49 50 - #include <plat/dmtimer.h> 50 + #include <clocksource/timer-ti-dm.h> 51 51 52 52 static u32 omap_reserved_systimers; 53 53 static LIST_HEAD(omap_timer_list); ··· 161 161 clk_put(parent); 162 162 163 163 return ret; 164 + } 165 + 166 + static int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) 167 + { 168 + int ret; 169 + const char *parent_name; 170 + struct clk *parent; 171 + struct dmtimer_platform_data *pdata; 172 + 173 + if (unlikely(!timer) || IS_ERR(timer->fclk)) 174 + return -EINVAL; 175 + 176 + switch (source) { 177 + case OMAP_TIMER_SRC_SYS_CLK: 178 + parent_name = "timer_sys_ck"; 179 + break; 180 + case OMAP_TIMER_SRC_32_KHZ: 181 + parent_name = "timer_32k_ck"; 182 + break; 183 + case OMAP_TIMER_SRC_EXT_CLK: 184 + parent_name = "timer_ext_ck"; 185 + break; 186 + default: 187 + return -EINVAL; 188 + } 189 + 190 + pdata = timer->pdev->dev.platform_data; 191 + 192 + /* 193 + * FIXME: Used for OMAP1 devices only because they do not currently 194 + * use the clock framework to set the parent clock. To be removed 195 + * once OMAP1 migrated to using clock framework for dmtimers 196 + */ 197 + if (pdata && pdata->set_timer_src) 198 + return pdata->set_timer_src(timer->pdev, source); 199 + 200 + #if defined(CONFIG_COMMON_CLK) 201 + /* Check if the clock has configurable parents */ 202 + if (clk_hw_get_num_parents(__clk_get_hw(timer->fclk)) < 2) 203 + return 0; 204 + #endif 205 + 206 + parent = clk_get(&timer->pdev->dev, parent_name); 207 + if (IS_ERR(parent)) { 208 + pr_err("%s: %s not found\n", __func__, parent_name); 209 + return -EINVAL; 210 + } 211 + 212 + ret = clk_set_parent(timer->fclk, parent); 213 + if (ret < 0) 214 + pr_err("%s: failed to set %s as parent\n", __func__, 215 + parent_name); 216 + 217 + clk_put(parent); 218 + 219 + return ret; 220 + } 221 + 222 + static void omap_dm_timer_enable(struct omap_dm_timer *timer) 223 + { 224 + int c; 225 + 226 + pm_runtime_get_sync(&timer->pdev->dev); 227 + 228 + if (!(timer->capability & OMAP_TIMER_ALWON)) { 229 + if (timer->get_context_loss_count) { 230 + c = timer->get_context_loss_count(&timer->pdev->dev); 231 + if (c != timer->ctx_loss_count) { 232 + omap_timer_restore_context(timer); 233 + timer->ctx_loss_count = c; 234 + } 235 + } else { 236 + omap_timer_restore_context(timer); 237 + } 238 + } 239 + } 240 + 241 + static void omap_dm_timer_disable(struct omap_dm_timer *timer) 242 + { 243 + pm_runtime_put_sync(&timer->pdev->dev); 164 244 } 165 245 166 246 static int omap_dm_timer_prepare(struct omap_dm_timer *timer) ··· 378 298 return timer; 379 299 } 380 300 381 - struct omap_dm_timer *omap_dm_timer_request(void) 301 + static struct omap_dm_timer *omap_dm_timer_request(void) 382 302 { 383 303 return _omap_dm_timer_request(REQUEST_ANY, NULL); 384 304 } 385 - EXPORT_SYMBOL_GPL(omap_dm_timer_request); 386 305 387 - struct omap_dm_timer *omap_dm_timer_request_specific(int id) 306 + static struct omap_dm_timer *omap_dm_timer_request_specific(int id) 388 307 { 389 308 /* Requesting timer by ID is not supported when device tree is used */ 390 309 if (of_have_populated_dt()) { 391 - pr_warn("%s: Please use omap_dm_timer_request_by_cap/node()\n", 310 + pr_warn("%s: Please use omap_dm_timer_request_by_node()\n", 392 311 __func__); 393 312 return NULL; 394 313 } 395 314 396 315 return _omap_dm_timer_request(REQUEST_BY_ID, &id); 397 316 } 398 - EXPORT_SYMBOL_GPL(omap_dm_timer_request_specific); 399 317 400 318 /** 401 319 * omap_dm_timer_request_by_cap - Request a timer by capability ··· 408 330 { 409 331 return _omap_dm_timer_request(REQUEST_BY_CAP, &cap); 410 332 } 411 - EXPORT_SYMBOL_GPL(omap_dm_timer_request_by_cap); 412 333 413 334 /** 414 335 * omap_dm_timer_request_by_node - Request a timer by device-tree node ··· 416 339 * Request a timer based upon a device node pointer. Returns pointer to 417 340 * timer handle on success and a NULL pointer on failure. 418 341 */ 419 - struct omap_dm_timer *omap_dm_timer_request_by_node(struct device_node *np) 342 + static struct omap_dm_timer *omap_dm_timer_request_by_node(struct device_node *np) 420 343 { 421 344 if (!np) 422 345 return NULL; 423 346 424 347 return _omap_dm_timer_request(REQUEST_BY_NODE, np); 425 348 } 426 - EXPORT_SYMBOL_GPL(omap_dm_timer_request_by_node); 427 349 428 - int omap_dm_timer_free(struct omap_dm_timer *timer) 350 + static int omap_dm_timer_free(struct omap_dm_timer *timer) 429 351 { 430 352 if (unlikely(!timer)) 431 353 return -EINVAL; ··· 435 359 timer->reserved = 0; 436 360 return 0; 437 361 } 438 - EXPORT_SYMBOL_GPL(omap_dm_timer_free); 439 - 440 - void omap_dm_timer_enable(struct omap_dm_timer *timer) 441 - { 442 - int c; 443 - 444 - pm_runtime_get_sync(&timer->pdev->dev); 445 - 446 - if (!(timer->capability & OMAP_TIMER_ALWON)) { 447 - if (timer->get_context_loss_count) { 448 - c = timer->get_context_loss_count(&timer->pdev->dev); 449 - if (c != timer->ctx_loss_count) { 450 - omap_timer_restore_context(timer); 451 - timer->ctx_loss_count = c; 452 - } 453 - } else { 454 - omap_timer_restore_context(timer); 455 - } 456 - } 457 - } 458 - EXPORT_SYMBOL_GPL(omap_dm_timer_enable); 459 - 460 - void omap_dm_timer_disable(struct omap_dm_timer *timer) 461 - { 462 - pm_runtime_put_sync(&timer->pdev->dev); 463 - } 464 - EXPORT_SYMBOL_GPL(omap_dm_timer_disable); 465 362 466 363 int omap_dm_timer_get_irq(struct omap_dm_timer *timer) 467 364 { ··· 442 393 return timer->irq; 443 394 return -EINVAL; 444 395 } 445 - EXPORT_SYMBOL_GPL(omap_dm_timer_get_irq); 446 396 447 397 #if defined(CONFIG_ARCH_OMAP1) 448 398 #include <mach/hardware.h> 399 + 400 + static struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) 401 + { 402 + return NULL; 403 + } 404 + 449 405 /** 450 406 * omap_dm_timer_modify_idlect_mask - Check if any running timers use ARMXOR 451 407 * @inputmask: current value of idlect mask ··· 483 429 484 430 return inputmask; 485 431 } 486 - EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask); 487 432 488 433 #else 489 434 490 - struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) 435 + static struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer) 491 436 { 492 437 if (timer && !IS_ERR(timer->fclk)) 493 438 return timer->fclk; 494 439 return NULL; 495 440 } 496 - EXPORT_SYMBOL_GPL(omap_dm_timer_get_fclk); 497 441 498 442 __u32 omap_dm_timer_modify_idlect_mask(__u32 inputmask) 499 443 { ··· 499 447 500 448 return 0; 501 449 } 502 - EXPORT_SYMBOL_GPL(omap_dm_timer_modify_idlect_mask); 503 450 504 451 #endif 505 452 ··· 512 461 omap_dm_timer_write_reg(timer, OMAP_TIMER_TRIGGER_REG, 0); 513 462 return 0; 514 463 } 515 - EXPORT_SYMBOL_GPL(omap_dm_timer_trigger); 516 464 517 - int omap_dm_timer_start(struct omap_dm_timer *timer) 465 + static int omap_dm_timer_start(struct omap_dm_timer *timer) 518 466 { 519 467 u32 l; 520 468 ··· 532 482 timer->context.tclr = l; 533 483 return 0; 534 484 } 535 - EXPORT_SYMBOL_GPL(omap_dm_timer_start); 536 485 537 - int omap_dm_timer_stop(struct omap_dm_timer *timer) 486 + static int omap_dm_timer_stop(struct omap_dm_timer *timer) 538 487 { 539 488 unsigned long rate = 0; 540 489 ··· 555 506 omap_dm_timer_disable(timer); 556 507 return 0; 557 508 } 558 - EXPORT_SYMBOL_GPL(omap_dm_timer_stop); 559 509 560 - int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source) 561 - { 562 - int ret; 563 - char *parent_name = NULL; 564 - struct clk *parent; 565 - struct dmtimer_platform_data *pdata; 566 - 567 - if (unlikely(!timer)) 568 - return -EINVAL; 569 - 570 - pdata = timer->pdev->dev.platform_data; 571 - 572 - if (source < 0 || source >= 3) 573 - return -EINVAL; 574 - 575 - /* 576 - * FIXME: Used for OMAP1 devices only because they do not currently 577 - * use the clock framework to set the parent clock. To be removed 578 - * once OMAP1 migrated to using clock framework for dmtimers 579 - */ 580 - if (pdata && pdata->set_timer_src) 581 - return pdata->set_timer_src(timer->pdev, source); 582 - 583 - if (IS_ERR(timer->fclk)) 584 - return -EINVAL; 585 - 586 - #if defined(CONFIG_COMMON_CLK) 587 - /* Check if the clock has configurable parents */ 588 - if (clk_hw_get_num_parents(__clk_get_hw(timer->fclk)) < 2) 589 - return 0; 590 - #endif 591 - 592 - switch (source) { 593 - case OMAP_TIMER_SRC_SYS_CLK: 594 - parent_name = "timer_sys_ck"; 595 - break; 596 - 597 - case OMAP_TIMER_SRC_32_KHZ: 598 - parent_name = "timer_32k_ck"; 599 - break; 600 - 601 - case OMAP_TIMER_SRC_EXT_CLK: 602 - parent_name = "timer_ext_ck"; 603 - break; 604 - } 605 - 606 - parent = clk_get(&timer->pdev->dev, parent_name); 607 - if (IS_ERR(parent)) { 608 - pr_err("%s: %s not found\n", __func__, parent_name); 609 - return -EINVAL; 610 - } 611 - 612 - ret = clk_set_parent(timer->fclk, parent); 613 - if (ret < 0) 614 - pr_err("%s: failed to set %s as parent\n", __func__, 615 - parent_name); 616 - 617 - clk_put(parent); 618 - 619 - return ret; 620 - } 621 - EXPORT_SYMBOL_GPL(omap_dm_timer_set_source); 622 - 623 - int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, 624 - unsigned int load) 510 + static int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, 511 + unsigned int load) 625 512 { 626 513 u32 l; 627 514 ··· 580 595 omap_dm_timer_disable(timer); 581 596 return 0; 582 597 } 583 - EXPORT_SYMBOL_GPL(omap_dm_timer_set_load); 584 598 585 599 /* Optimized set_load which removes costly spin wait in timer_start */ 586 600 int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, ··· 609 625 timer->context.tcrr = load; 610 626 return 0; 611 627 } 612 - EXPORT_SYMBOL_GPL(omap_dm_timer_set_load_start); 613 - 614 - int omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, 615 - unsigned int match) 628 + static int omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, 629 + unsigned int match) 616 630 { 617 631 u32 l; 618 632 ··· 632 650 omap_dm_timer_disable(timer); 633 651 return 0; 634 652 } 635 - EXPORT_SYMBOL_GPL(omap_dm_timer_set_match); 636 653 637 - int omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, 638 - int toggle, int trigger) 654 + static int omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, 655 + int toggle, int trigger) 639 656 { 640 657 u32 l; 641 658 ··· 657 676 omap_dm_timer_disable(timer); 658 677 return 0; 659 678 } 660 - EXPORT_SYMBOL_GPL(omap_dm_timer_set_pwm); 661 679 662 - int omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler) 680 + static int omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, 681 + int prescaler) 663 682 { 664 683 u32 l; 665 684 666 - if (unlikely(!timer)) 685 + if (unlikely(!timer) || prescaler < -1 || prescaler > 7) 667 686 return -EINVAL; 668 687 669 688 omap_dm_timer_enable(timer); 670 689 l = omap_dm_timer_read_reg(timer, OMAP_TIMER_CTRL_REG); 671 690 l &= ~(OMAP_TIMER_CTRL_PRE | (0x07 << 2)); 672 - if (prescaler >= 0x00 && prescaler <= 0x07) { 691 + if (prescaler >= 0) { 673 692 l |= OMAP_TIMER_CTRL_PRE; 674 693 l |= prescaler << 2; 675 694 } ··· 680 699 omap_dm_timer_disable(timer); 681 700 return 0; 682 701 } 683 - EXPORT_SYMBOL_GPL(omap_dm_timer_set_prescaler); 684 702 685 - int omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, 686 - unsigned int value) 703 + static int omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, 704 + unsigned int value) 687 705 { 688 706 if (unlikely(!timer)) 689 707 return -EINVAL; ··· 696 716 omap_dm_timer_disable(timer); 697 717 return 0; 698 718 } 699 - EXPORT_SYMBOL_GPL(omap_dm_timer_set_int_enable); 700 719 701 720 /** 702 721 * omap_dm_timer_set_int_disable - disable timer interrupts ··· 704 725 * 705 726 * Disables the specified timer interrupts for a timer. 706 727 */ 707 - int omap_dm_timer_set_int_disable(struct omap_dm_timer *timer, u32 mask) 728 + static int omap_dm_timer_set_int_disable(struct omap_dm_timer *timer, u32 mask) 708 729 { 709 730 u32 l = mask; 710 731 ··· 726 747 omap_dm_timer_disable(timer); 727 748 return 0; 728 749 } 729 - EXPORT_SYMBOL_GPL(omap_dm_timer_set_int_disable); 730 750 731 - unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer) 751 + static unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer) 732 752 { 733 753 unsigned int l; 734 754 ··· 740 762 741 763 return l; 742 764 } 743 - EXPORT_SYMBOL_GPL(omap_dm_timer_read_status); 744 765 745 - int omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value) 766 + static int omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value) 746 767 { 747 768 if (unlikely(!timer || pm_runtime_suspended(&timer->pdev->dev))) 748 769 return -EINVAL; ··· 750 773 751 774 return 0; 752 775 } 753 - EXPORT_SYMBOL_GPL(omap_dm_timer_write_status); 754 776 755 - unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer) 777 + static unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer) 756 778 { 757 779 if (unlikely(!timer || pm_runtime_suspended(&timer->pdev->dev))) { 758 780 pr_err("%s: timer not iavailable or enabled.\n", __func__); ··· 760 784 761 785 return __omap_dm_timer_read_counter(timer, timer->posted); 762 786 } 763 - EXPORT_SYMBOL_GPL(omap_dm_timer_read_counter); 764 787 765 - int omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value) 788 + static int omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value) 766 789 { 767 790 if (unlikely(!timer || pm_runtime_suspended(&timer->pdev->dev))) { 768 791 pr_err("%s: timer not available or enabled.\n", __func__); ··· 774 799 timer->context.tcrr = value; 775 800 return 0; 776 801 } 777 - EXPORT_SYMBOL_GPL(omap_dm_timer_write_counter); 778 802 779 803 int omap_dm_timers_active(void) 780 804 { ··· 790 816 } 791 817 return 0; 792 818 } 793 - EXPORT_SYMBOL_GPL(omap_dm_timers_active); 794 819 795 820 static const struct of_device_id omap_timer_match[]; 796 821 ··· 806 833 struct omap_dm_timer *timer; 807 834 struct resource *mem, *irq; 808 835 struct device *dev = &pdev->dev; 809 - const struct of_device_id *match; 810 836 const struct dmtimer_platform_data *pdata; 811 837 int ret; 812 838 813 - match = of_match_device(of_match_ptr(omap_timer_match), dev); 814 - pdata = match ? match->data : dev->platform_data; 839 + pdata = of_device_get_match_data(dev); 840 + if (!pdata) 841 + pdata = dev_get_platdata(dev); 842 + else 843 + dev->platform_data = (void *)pdata; 815 844 816 - if (!pdata && !dev->of_node) { 845 + if (!pdata) { 817 846 dev_err(dev, "%s: no platform data.\n", __func__); 818 847 return -ENODEV; 819 848 } ··· 921 946 return ret; 922 947 } 923 948 949 + const static struct omap_dm_timer_ops dmtimer_ops = { 950 + .request_by_node = omap_dm_timer_request_by_node, 951 + .request_specific = omap_dm_timer_request_specific, 952 + .request = omap_dm_timer_request, 953 + .set_source = omap_dm_timer_set_source, 954 + .get_irq = omap_dm_timer_get_irq, 955 + .set_int_enable = omap_dm_timer_set_int_enable, 956 + .set_int_disable = omap_dm_timer_set_int_disable, 957 + .free = omap_dm_timer_free, 958 + .enable = omap_dm_timer_enable, 959 + .disable = omap_dm_timer_disable, 960 + .get_fclk = omap_dm_timer_get_fclk, 961 + .start = omap_dm_timer_start, 962 + .stop = omap_dm_timer_stop, 963 + .set_load = omap_dm_timer_set_load, 964 + .set_match = omap_dm_timer_set_match, 965 + .set_pwm = omap_dm_timer_set_pwm, 966 + .set_prescaler = omap_dm_timer_set_prescaler, 967 + .read_counter = omap_dm_timer_read_counter, 968 + .write_counter = omap_dm_timer_write_counter, 969 + .read_status = omap_dm_timer_read_status, 970 + .write_status = omap_dm_timer_write_status, 971 + }; 972 + 924 973 static const struct dmtimer_platform_data omap3plus_pdata = { 925 974 .timer_errata = OMAP_TIMER_ERRATA_I103_I767, 975 + .timer_ops = &dmtimer_ops, 926 976 }; 927 977 928 978 static const struct of_device_id omap_timer_match[] = {
+10 -34
arch/arm/plat-omap/include/plat/dmtimer.h include/clocksource/timer-ti-dm.h
··· 1 1 /* 2 - * arch/arm/plat-omap/include/plat/dmtimer.h 3 - * 4 2 * OMAP Dual-Mode Timers 5 3 * 6 4 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/ ··· 34 36 #include <linux/io.h> 35 37 #include <linux/platform_device.h> 36 38 37 - #ifndef __ASM_ARCH_DMTIMER_H 38 - #define __ASM_ARCH_DMTIMER_H 39 + #ifndef __CLOCKSOURCE_DMTIMER_H 40 + #define __CLOCKSOURCE_DMTIMER_H 39 41 40 42 /* clock sources */ 41 43 #define OMAP_TIMER_SRC_SYS_CLK 0x00 ··· 72 74 * the OMAP3/4/5 errata documents. 73 75 */ 74 76 #define OMAP_TIMER_ERRATA_I103_I767 0x80000000 75 - 76 - struct omap_timer_capability_dev_attr { 77 - u32 timer_capability; 78 - }; 79 77 80 78 struct timer_regs { 81 79 u32 tidr; ··· 119 125 }; 120 126 121 127 int omap_dm_timer_reserve_systimer(int id); 122 - struct omap_dm_timer *omap_dm_timer_request(void); 123 - struct omap_dm_timer *omap_dm_timer_request_specific(int timer_id); 124 128 struct omap_dm_timer *omap_dm_timer_request_by_cap(u32 cap); 125 - struct omap_dm_timer *omap_dm_timer_request_by_node(struct device_node *np); 126 - int omap_dm_timer_free(struct omap_dm_timer *timer); 127 - void omap_dm_timer_enable(struct omap_dm_timer *timer); 128 - void omap_dm_timer_disable(struct omap_dm_timer *timer); 129 129 130 130 int omap_dm_timer_get_irq(struct omap_dm_timer *timer); 131 131 132 132 u32 omap_dm_timer_modify_idlect_mask(u32 inputmask); 133 - struct clk *omap_dm_timer_get_fclk(struct omap_dm_timer *timer); 134 133 135 134 int omap_dm_timer_trigger(struct omap_dm_timer *timer); 136 - int omap_dm_timer_start(struct omap_dm_timer *timer); 137 - int omap_dm_timer_stop(struct omap_dm_timer *timer); 138 - 139 - int omap_dm_timer_set_source(struct omap_dm_timer *timer, int source); 140 - int omap_dm_timer_set_load(struct omap_dm_timer *timer, int autoreload, unsigned int value); 141 - int omap_dm_timer_set_load_start(struct omap_dm_timer *timer, int autoreload, unsigned int value); 142 - int omap_dm_timer_set_match(struct omap_dm_timer *timer, int enable, unsigned int match); 143 - int omap_dm_timer_set_pwm(struct omap_dm_timer *timer, int def_on, int toggle, int trigger); 144 - int omap_dm_timer_set_prescaler(struct omap_dm_timer *timer, int prescaler); 145 - 146 - int omap_dm_timer_set_int_enable(struct omap_dm_timer *timer, unsigned int value); 147 - int omap_dm_timer_set_int_disable(struct omap_dm_timer *timer, u32 mask); 148 - 149 - unsigned int omap_dm_timer_read_status(struct omap_dm_timer *timer); 150 - int omap_dm_timer_write_status(struct omap_dm_timer *timer, unsigned int value); 151 - unsigned int omap_dm_timer_read_counter(struct omap_dm_timer *timer); 152 - int omap_dm_timer_write_counter(struct omap_dm_timer *timer, unsigned int value); 153 135 154 136 int omap_dm_timers_active(void); 155 137 ··· 246 276 #define OMAP_TIMER_TICK_INT_MASK_COUNT_REG \ 247 277 (_OMAP_TIMER_TICK_INT_MASK_COUNT_OFFSET | (WP_TOWR << WPSHIFT)) 248 278 279 + /* 280 + * The below are inlined to optimize code size for system timers. Other code 281 + * should not need these at all, see 282 + * include/linux/platform_data/pwm_omap_dmtimer.h 283 + */ 284 + #if defined(CONFIG_ARCH_OMAP1) || defined(CONFIG_ARCH_OMAP2PLUS) 249 285 static inline u32 __omap_dm_timer_read(struct omap_dm_timer *timer, u32 reg, 250 286 int posted) 251 287 { ··· 390 414 { 391 415 writel_relaxed(value, timer->irq_stat); 392 416 } 393 - 394 - #endif /* __ASM_ARCH_DMTIMER_H */ 417 + #endif /* CONFIG_ARCH_OMAP1 || CONFIG_ARCH_OMAP2PLUS */ 418 + #endif /* __CLOCKSOURCE_DMTIMER_H */
+3 -6
arch/arm/plat-omap/include/plat/i2c.h arch/arm/mach-omap1/i2c.h
··· 19 19 * 20 20 */ 21 21 22 - #ifndef __PLAT_OMAP_I2C_H 23 - #define __PLAT_OMAP_I2C_H 22 + #ifndef __ARCH_ARM_MACH_OMAP1_I2C_H 23 + #define __ARCH_ARM_MACH_OMAP1_I2C_H 24 24 25 25 struct i2c_board_info; 26 26 struct omap_i2c_bus_platform_data; ··· 47 47 } 48 48 #endif 49 49 50 - struct omap_hwmod; 51 - int omap_i2c_reset(struct omap_hwmod *oh); 52 - 53 - #endif /* __PLAT_OMAP_I2C_H */ 50 + #endif /* __ARCH_ARM_MACH_OMAP1_I2C_H */
+38 -1
arch/arm64/configs/defconfig
··· 31 31 CONFIG_JUMP_LABEL=y 32 32 CONFIG_MODULES=y 33 33 CONFIG_MODULE_UNLOAD=y 34 - # CONFIG_IOSCHED_DEADLINE is not set 35 34 CONFIG_ARCH_SUNXI=y 36 35 CONFIG_ARCH_ALPINE=y 37 36 CONFIG_ARCH_BCM2835=y ··· 50 51 CONFIG_ARCH_RENESAS=y 51 52 CONFIG_ARCH_R8A7795=y 52 53 CONFIG_ARCH_R8A7796=y 54 + CONFIG_ARCH_R8A77965=y 53 55 CONFIG_ARCH_R8A77970=y 56 + CONFIG_ARCH_R8A77980=y 54 57 CONFIG_ARCH_R8A77995=y 55 58 CONFIG_ARCH_STRATIX10=y 56 59 CONFIG_ARCH_TEGRA=y 57 60 CONFIG_ARCH_SPRD=y 61 + CONFIG_ARCH_SYNQUACER=y 58 62 CONFIG_ARCH_THUNDER=y 59 63 CONFIG_ARCH_THUNDER2=y 60 64 CONFIG_ARCH_UNIPHIER=y ··· 101 99 CONFIG_WQ_POWER_EFFICIENT_DEFAULT=y 102 100 CONFIG_ARM_CPUIDLE=y 103 101 CONFIG_CPU_FREQ=y 102 + CONFIG_CPU_FREQ_GOV_ATTR_SET=y 103 + CONFIG_CPU_FREQ_GOV_COMMON=y 104 + CONFIG_CPU_FREQ_STAT=y 105 + CONFIG_CPU_FREQ_GOV_POWERSAVE=m 106 + CONFIG_CPU_FREQ_GOV_USERSPACE=y 107 + CONFIG_CPU_FREQ_GOV_ONDEMAND=y 108 + CONFIG_CPU_FREQ_GOV_CONSERVATIVE=m 109 + CONFIG_CPU_FREQ_GOV_SCHEDUTIL=y 104 110 CONFIG_CPUFREQ_DT=y 105 111 CONFIG_ARM_ARMADA_37XX_CPUFREQ=y 106 112 CONFIG_ARM_BIG_LITTLE_CPUFREQ=y 107 113 CONFIG_ARM_SCPI_CPUFREQ=y 114 + CONFIG_ARM_TEGRA186_CPUFREQ=y 108 115 CONFIG_ACPI_CPPC_CPUFREQ=m 109 116 CONFIG_NET=y 110 117 CONFIG_PACKET=y ··· 220 209 CONFIG_RAVB=y 221 210 CONFIG_SMC91X=y 222 211 CONFIG_SMSC911X=y 212 + CONFIG_SNI_AVE=y 213 + CONFIG_SNI_NETSEC=y 223 214 CONFIG_STMMAC_ETH=m 215 + CONFIG_DWMAC_IPQ806X=m 216 + CONFIG_DWMAC_MESON=m 217 + CONFIG_DWMAC_ROCKCHIP=m 218 + CONFIG_DWMAC_SUNXI=m 219 + CONFIG_DWMAC_SUN8I=m 224 220 CONFIG_MDIO_BUS_MUX_MMIOREG=y 225 221 CONFIG_AT803X_PHY=m 226 222 CONFIG_MARVELL_PHY=m ··· 323 305 CONFIG_PINCTRL_QDF2XXX=y 324 306 CONFIG_PINCTRL_QCOM_SPMI_PMIC=y 325 307 CONFIG_GPIO_DWAPB=y 308 + CONFIG_GPIO_MB86S7X=y 326 309 CONFIG_GPIO_PL061=y 327 310 CONFIG_GPIO_RCAR=y 328 311 CONFIG_GPIO_UNIPHIER=y ··· 346 327 CONFIG_BRCMSTB_THERMAL=m 347 328 CONFIG_EXYNOS_THERMAL=y 348 329 CONFIG_RCAR_GEN3_THERMAL=y 330 + CONFIG_QCOM_TSENS=y 349 331 CONFIG_ROCKCHIP_THERMAL=m 332 + CONFIG_TEGRA_BPMP_THERMAL=m 333 + CONFIG_UNIPHIER_THERMAL=y 350 334 CONFIG_WATCHDOG=y 351 335 CONFIG_S3C2410_WATCHDOG=y 352 336 CONFIG_MESON_GXBB_WATCHDOG=m ··· 466 444 CONFIG_USB_ULPI=y 467 445 CONFIG_USB_GADGET=y 468 446 CONFIG_USB_RENESAS_USBHS_UDC=m 447 + CONFIG_USB_RENESAS_USB3=m 469 448 CONFIG_USB_ULPI_BUS=y 470 449 CONFIG_MMC=y 471 450 CONFIG_MMC_BLOCK_MINORS=32 472 451 CONFIG_MMC_ARMMMCI=y 473 452 CONFIG_MMC_SDHCI=y 474 453 CONFIG_MMC_SDHCI_ACPI=y 454 + CONFIG_MMC_SDHCI_F_SDH30=y 475 455 CONFIG_MMC_SDHCI_PLTFM=y 476 456 CONFIG_MMC_SDHCI_OF_ARASAN=y 477 457 CONFIG_MMC_SDHCI_OF_ESDHC=y ··· 524 500 CONFIG_QCOM_HIDMA_MGMT=y 525 501 CONFIG_QCOM_HIDMA=y 526 502 CONFIG_RCAR_DMAC=y 503 + CONFIG_RENESAS_USB_DMAC=m 527 504 CONFIG_VFIO=y 528 505 CONFIG_VFIO_PCI=y 529 506 CONFIG_VIRTIO_PCI=y ··· 550 525 CONFIG_PLATFORM_MHU=y 551 526 CONFIG_BCM2835_MBOX=y 552 527 CONFIG_HI6220_MBOX=y 528 + CONFIG_QCOM_APCS_IPC=y 553 529 CONFIG_ROCKCHIP_IOMMU=y 530 + CONFIG_TEGRA_IOMMU_SMMU=y 554 531 CONFIG_ARM_SMMU=y 555 532 CONFIG_ARM_SMMU_V3=y 556 533 CONFIG_QCOM_IOMMU=y ··· 566 539 CONFIG_ARCH_TEGRA_132_SOC=y 567 540 CONFIG_ARCH_TEGRA_210_SOC=y 568 541 CONFIG_ARCH_TEGRA_186_SOC=y 542 + CONFIG_ARCH_TEGRA_194_SOC=y 569 543 CONFIG_EXTCON_USB_GPIO=y 544 + CONFIG_MEMORY=y 545 + CONFIG_TEGRA_MC=y 570 546 CONFIG_IIO=y 571 547 CONFIG_EXYNOS_ADC=y 572 548 CONFIG_ROCKCHIP_SARADC=m ··· 577 547 CONFIG_PWM_BCM2835=m 578 548 CONFIG_PWM_CROS_EC=m 579 549 CONFIG_PWM_MESON=m 550 + CONFIG_PWM_RCAR=m 580 551 CONFIG_PWM_ROCKCHIP=y 581 552 CONFIG_PWM_SAMSUNG=y 582 553 CONFIG_PWM_TEGRA=m 583 554 CONFIG_PHY_RCAR_GEN3_USB2=y 555 + CONFIG_PHY_RCAR_GEN3_USB3=m 584 556 CONFIG_PHY_HI6220_USB=y 585 557 CONFIG_PHY_QCOM_USB_HS=y 586 558 CONFIG_PHY_SUN4I_USB=y ··· 594 562 CONFIG_PHY_TEGRA_XUSB=y 595 563 CONFIG_QCOM_L2_PMU=y 596 564 CONFIG_QCOM_L3_PMU=y 565 + CONFIG_MESON_EFUSE=m 566 + CONFIG_QCOM_QFPROM=y 597 567 CONFIG_UNIPHIER_EFUSE=y 598 568 CONFIG_TEE=y 599 569 CONFIG_OPTEE=y ··· 663 629 CONFIG_CRYPTO_AES_ARM64_NEON_BLK=m 664 630 CONFIG_CRYPTO_CHACHA20_NEON=m 665 631 CONFIG_CRYPTO_AES_ARM64_BS=m 632 + CONFIG_CRYPTO_SHA512_ARM64_CE=m 633 + CONFIG_CRYPTO_SHA3_ARM64=m 634 + CONFIG_CRYPTO_SM3_ARM64_CE=m
+494 -34
drivers/bus/ti-sysc.c
··· 13 13 14 14 #include <linux/io.h> 15 15 #include <linux/clk.h> 16 + #include <linux/clkdev.h> 17 + #include <linux/delay.h> 16 18 #include <linux/module.h> 17 19 #include <linux/platform_device.h> 20 + #include <linux/pm_domain.h> 18 21 #include <linux/pm_runtime.h> 19 22 #include <linux/of_address.h> 20 23 #include <linux/of_platform.h> 24 + #include <linux/slab.h> 25 + 21 26 #include <linux/platform_data/ti-sysc.h> 22 27 23 28 #include <dt-bindings/bus/ti-sysc.h> 24 - 25 - enum sysc_registers { 26 - SYSC_REVISION, 27 - SYSC_SYSCONFIG, 28 - SYSC_SYSSTATUS, 29 - SYSC_MAX_REGS, 30 - }; 31 29 32 30 static const char * const reg_names[] = { "rev", "sysc", "syss", }; 33 31 ··· 53 55 * @cfg: interconnect target module configuration 54 56 * @name: name if available 55 57 * @revision: interconnect target module revision 58 + * @needs_resume: runtime resume needed on resume from suspend 56 59 */ 57 60 struct sysc { 58 61 struct device *dev; ··· 65 66 const char *legacy_mode; 66 67 const struct sysc_capabilities *cap; 67 68 struct sysc_config cfg; 69 + struct ti_sysc_cookie cookie; 68 70 const char *name; 69 71 u32 revision; 72 + bool enabled; 73 + bool needs_resume; 74 + bool child_needs_resume; 75 + struct delayed_work idle_work; 70 76 }; 71 77 72 78 static u32 sysc_read(struct sysc *ddata, int offset) ··· 140 136 { 141 137 int i, error; 142 138 143 - if (ddata->legacy_mode) 144 - return 0; 145 - 146 139 for (i = 0; i < SYSC_MAX_CLOCKS; i++) { 147 140 error = sysc_get_one_clock(ddata, i); 148 141 if (error && error != -ENOENT) ··· 198 197 ddata->module_pa = of_translate_address(np, ranges++); 199 198 ddata->module_size = be32_to_cpup(ranges); 200 199 201 - dev_dbg(ddata->dev, "interconnect target 0x%llx size 0x%x for %pOF\n", 202 - ddata->module_pa, ddata->module_size, np); 203 - 204 200 return 0; 201 + } 202 + 203 + static struct device_node *stdout_path; 204 + 205 + static void sysc_init_stdout_path(struct sysc *ddata) 206 + { 207 + struct device_node *np = NULL; 208 + const char *uart; 209 + 210 + if (IS_ERR(stdout_path)) 211 + return; 212 + 213 + if (stdout_path) 214 + return; 215 + 216 + np = of_find_node_by_path("/chosen"); 217 + if (!np) 218 + goto err; 219 + 220 + uart = of_get_property(np, "stdout-path", NULL); 221 + if (!uart) 222 + goto err; 223 + 224 + np = of_find_node_by_path(uart); 225 + if (!np) 226 + goto err; 227 + 228 + stdout_path = np; 229 + 230 + return; 231 + 232 + err: 233 + stdout_path = ERR_PTR(-ENODEV); 234 + } 235 + 236 + static void sysc_check_quirk_stdout(struct sysc *ddata, 237 + struct device_node *np) 238 + { 239 + sysc_init_stdout_path(ddata); 240 + if (np != stdout_path) 241 + return; 242 + 243 + ddata->cfg.quirks |= SYSC_QUIRK_NO_IDLE_ON_INIT | 244 + SYSC_QUIRK_NO_RESET_ON_INIT; 205 245 } 206 246 207 247 /** ··· 262 220 name = of_get_property(np, "ti,hwmods", NULL); 263 221 if (name) 264 222 dev_warn(ddata->dev, "really a child ti,hwmods property?"); 223 + 224 + sysc_check_quirk_stdout(ddata, np); 265 225 266 226 return 0; 267 227 } ··· 290 246 */ 291 247 static void sysc_check_quirk_16bit(struct sysc *ddata, struct resource *res) 292 248 { 293 - if (resource_size(res) == 8) { 294 - dev_dbg(ddata->dev, 295 - "enabling 16-bit and clockactivity quirks\n"); 249 + if (resource_size(res) == 8) 296 250 ddata->cfg.quirks |= SYSC_QUIRK_16BIT | SYSC_QUIRK_USE_CLOCKACT; 297 - } 298 251 } 299 252 300 253 /** ··· 317 276 res = platform_get_resource_byname(to_platform_device(ddata->dev), 318 277 IORESOURCE_MEM, name); 319 278 if (!res) { 320 - dev_dbg(ddata->dev, "has no %s register\n", name); 321 279 ddata->offsets[reg] = -ENODEV; 322 280 323 281 return 0; ··· 477 437 return sprintf(bufp, ":%x", ddata->offsets[reg]); 478 438 } 479 439 440 + static int sysc_show_name(char *bufp, struct sysc *ddata) 441 + { 442 + if (!ddata->name) 443 + return 0; 444 + 445 + return sprintf(bufp, ":%s", ddata->name); 446 + } 447 + 480 448 /** 481 449 * sysc_show_registers - show information about interconnect target module 482 450 * @ddata: device driver data ··· 499 451 bufp += sysc_show_reg(ddata, bufp, i); 500 452 501 453 bufp += sysc_show_rev(bufp, ddata); 454 + bufp += sysc_show_name(bufp, ddata); 502 455 503 456 dev_dbg(ddata->dev, "%llx:%x%s\n", 504 457 ddata->module_pa, ddata->module_size, ··· 508 459 509 460 static int __maybe_unused sysc_runtime_suspend(struct device *dev) 510 461 { 462 + struct ti_sysc_platform_data *pdata; 511 463 struct sysc *ddata; 512 - int i; 464 + int error = 0, i; 513 465 514 466 ddata = dev_get_drvdata(dev); 515 467 516 - if (ddata->legacy_mode) 468 + if (!ddata->enabled) 517 469 return 0; 470 + 471 + if (ddata->legacy_mode) { 472 + pdata = dev_get_platdata(ddata->dev); 473 + if (!pdata) 474 + return 0; 475 + 476 + if (!pdata->idle_module) 477 + return -ENODEV; 478 + 479 + error = pdata->idle_module(dev, &ddata->cookie); 480 + if (error) 481 + dev_err(dev, "%s: could not idle: %i\n", 482 + __func__, error); 483 + 484 + goto idled; 485 + } 518 486 519 487 for (i = 0; i < SYSC_MAX_CLOCKS; i++) { 520 488 if (IS_ERR_OR_NULL(ddata->clocks[i])) ··· 539 473 clk_disable(ddata->clocks[i]); 540 474 } 541 475 542 - return 0; 476 + idled: 477 + ddata->enabled = false; 478 + 479 + return error; 543 480 } 544 481 545 482 static int __maybe_unused sysc_runtime_resume(struct device *dev) 546 483 { 484 + struct ti_sysc_platform_data *pdata; 547 485 struct sysc *ddata; 548 - int i, error; 486 + int error = 0, i; 549 487 550 488 ddata = dev_get_drvdata(dev); 551 489 552 - if (ddata->legacy_mode) 490 + if (ddata->enabled) 553 491 return 0; 492 + 493 + if (ddata->legacy_mode) { 494 + pdata = dev_get_platdata(ddata->dev); 495 + if (!pdata) 496 + return 0; 497 + 498 + if (!pdata->enable_module) 499 + return -ENODEV; 500 + 501 + error = pdata->enable_module(dev, &ddata->cookie); 502 + if (error) 503 + dev_err(dev, "%s: could not enable: %i\n", 504 + __func__, error); 505 + 506 + goto awake; 507 + } 554 508 555 509 for (i = 0; i < SYSC_MAX_CLOCKS; i++) { 556 510 if (IS_ERR_OR_NULL(ddata->clocks[i])) ··· 580 494 return error; 581 495 } 582 496 583 - return 0; 497 + awake: 498 + ddata->enabled = true; 499 + 500 + return error; 584 501 } 585 502 503 + #ifdef CONFIG_PM_SLEEP 504 + static int sysc_suspend(struct device *dev) 505 + { 506 + struct sysc *ddata; 507 + 508 + ddata = dev_get_drvdata(dev); 509 + 510 + if (!ddata->enabled) 511 + return 0; 512 + 513 + ddata->needs_resume = true; 514 + 515 + return sysc_runtime_suspend(dev); 516 + } 517 + 518 + static int sysc_resume(struct device *dev) 519 + { 520 + struct sysc *ddata; 521 + 522 + ddata = dev_get_drvdata(dev); 523 + if (ddata->needs_resume) { 524 + ddata->needs_resume = false; 525 + 526 + return sysc_runtime_resume(dev); 527 + } 528 + 529 + return 0; 530 + } 531 + #endif 532 + 586 533 static const struct dev_pm_ops sysc_pm_ops = { 534 + SET_SYSTEM_SLEEP_PM_OPS(sysc_suspend, sysc_resume) 587 535 SET_RUNTIME_PM_OPS(sysc_runtime_suspend, 588 536 sysc_runtime_resume, 589 537 NULL) 590 538 }; 591 539 540 + /* Module revision register based quirks */ 541 + struct sysc_revision_quirk { 542 + const char *name; 543 + u32 base; 544 + int rev_offset; 545 + int sysc_offset; 546 + int syss_offset; 547 + u32 revision; 548 + u32 revision_mask; 549 + u32 quirks; 550 + }; 551 + 552 + #define SYSC_QUIRK(optname, optbase, optrev, optsysc, optsyss, \ 553 + optrev_val, optrevmask, optquirkmask) \ 554 + { \ 555 + .name = (optname), \ 556 + .base = (optbase), \ 557 + .rev_offset = (optrev), \ 558 + .sysc_offset = (optsysc), \ 559 + .syss_offset = (optsyss), \ 560 + .revision = (optrev_val), \ 561 + .revision_mask = (optrevmask), \ 562 + .quirks = (optquirkmask), \ 563 + } 564 + 565 + static const struct sysc_revision_quirk sysc_revision_quirks[] = { 566 + /* These drivers need to be fixed to not use pm_runtime_irq_safe() */ 567 + SYSC_QUIRK("gpio", 0, 0, 0x10, 0x114, 0x50600801, 0xffffffff, 568 + SYSC_QUIRK_LEGACY_IDLE), 569 + SYSC_QUIRK("mmu", 0, 0, 0x10, 0x14, 0x00000020, 0xffffffff, 570 + SYSC_QUIRK_LEGACY_IDLE), 571 + SYSC_QUIRK("mmu", 0, 0, 0x10, 0x14, 0x00000030, 0xffffffff, 572 + SYSC_QUIRK_LEGACY_IDLE), 573 + SYSC_QUIRK("sham", 0, 0x100, 0x110, 0x114, 0x40000c03, 0xffffffff, 574 + SYSC_QUIRK_LEGACY_IDLE), 575 + SYSC_QUIRK("smartreflex", 0, -1, 0x24, -1, 0x00000000, 0xffffffff, 576 + SYSC_QUIRK_LEGACY_IDLE), 577 + SYSC_QUIRK("smartreflex", 0, -1, 0x38, -1, 0x00000000, 0xffffffff, 578 + SYSC_QUIRK_LEGACY_IDLE), 579 + SYSC_QUIRK("timer", 0, 0, 0x10, 0x14, 0x00000015, 0xffffffff, 580 + SYSC_QUIRK_LEGACY_IDLE), 581 + SYSC_QUIRK("uart", 0, 0x50, 0x54, 0x58, 0x00000052, 0xffffffff, 582 + SYSC_QUIRK_LEGACY_IDLE), 583 + }; 584 + 585 + static void sysc_init_revision_quirks(struct sysc *ddata) 586 + { 587 + const struct sysc_revision_quirk *q; 588 + int i; 589 + 590 + for (i = 0; i < ARRAY_SIZE(sysc_revision_quirks); i++) { 591 + q = &sysc_revision_quirks[i]; 592 + 593 + if (q->base && q->base != ddata->module_pa) 594 + continue; 595 + 596 + if (q->rev_offset >= 0 && 597 + q->rev_offset != ddata->offsets[SYSC_REVISION]) 598 + continue; 599 + 600 + if (q->sysc_offset >= 0 && 601 + q->sysc_offset != ddata->offsets[SYSC_SYSCONFIG]) 602 + continue; 603 + 604 + if (q->syss_offset >= 0 && 605 + q->syss_offset != ddata->offsets[SYSC_SYSSTATUS]) 606 + continue; 607 + 608 + if (q->revision == ddata->revision || 609 + (q->revision & q->revision_mask) == 610 + (ddata->revision & q->revision_mask)) { 611 + ddata->name = q->name; 612 + ddata->cfg.quirks |= q->quirks; 613 + } 614 + } 615 + } 616 + 592 617 /* At this point the module is configured enough to read the revision */ 593 618 static int sysc_init_module(struct sysc *ddata) 594 619 { 595 620 int error; 621 + 622 + if (ddata->cfg.quirks & SYSC_QUIRK_NO_IDLE_ON_INIT) { 623 + ddata->revision = sysc_read_revision(ddata); 624 + goto rev_quirks; 625 + } 596 626 597 627 error = pm_runtime_get_sync(ddata->dev); 598 628 if (error < 0) { ··· 718 516 } 719 517 ddata->revision = sysc_read_revision(ddata); 720 518 pm_runtime_put_sync(ddata->dev); 519 + 520 + rev_quirks: 521 + sysc_init_revision_quirks(ddata); 721 522 722 523 return 0; 723 524 } ··· 809 604 810 605 return 0; 811 606 } 607 + 608 + /* 609 + * Many child device drivers need to have fck available to get the clock 610 + * rate for device internal configuration. 611 + */ 612 + static int sysc_child_add_fck(struct sysc *ddata, 613 + struct device *child) 614 + { 615 + struct clk *fck; 616 + struct clk_lookup *l; 617 + const char *name = clock_names[SYSC_FCK]; 618 + 619 + if (IS_ERR_OR_NULL(ddata->clocks[SYSC_FCK])) 620 + return 0; 621 + 622 + fck = clk_get(child, name); 623 + if (!IS_ERR(fck)) { 624 + clk_put(fck); 625 + 626 + return -EEXIST; 627 + } 628 + 629 + l = clkdev_create(ddata->clocks[SYSC_FCK], name, dev_name(child)); 630 + 631 + return l ? 0 : -ENODEV; 632 + } 633 + 634 + static struct device_type sysc_device_type = { 635 + }; 636 + 637 + static struct sysc *sysc_child_to_parent(struct device *dev) 638 + { 639 + struct device *parent = dev->parent; 640 + 641 + if (!parent || parent->type != &sysc_device_type) 642 + return NULL; 643 + 644 + return dev_get_drvdata(parent); 645 + } 646 + 647 + static int __maybe_unused sysc_child_runtime_suspend(struct device *dev) 648 + { 649 + struct sysc *ddata; 650 + int error; 651 + 652 + ddata = sysc_child_to_parent(dev); 653 + 654 + error = pm_generic_runtime_suspend(dev); 655 + if (error) 656 + return error; 657 + 658 + if (!ddata->enabled) 659 + return 0; 660 + 661 + return sysc_runtime_suspend(ddata->dev); 662 + } 663 + 664 + static int __maybe_unused sysc_child_runtime_resume(struct device *dev) 665 + { 666 + struct sysc *ddata; 667 + int error; 668 + 669 + ddata = sysc_child_to_parent(dev); 670 + 671 + if (!ddata->enabled) { 672 + error = sysc_runtime_resume(ddata->dev); 673 + if (error < 0) 674 + dev_err(ddata->dev, 675 + "%s error: %i\n", __func__, error); 676 + } 677 + 678 + return pm_generic_runtime_resume(dev); 679 + } 680 + 681 + #ifdef CONFIG_PM_SLEEP 682 + static int sysc_child_suspend_noirq(struct device *dev) 683 + { 684 + struct sysc *ddata; 685 + int error; 686 + 687 + ddata = sysc_child_to_parent(dev); 688 + 689 + error = pm_generic_suspend_noirq(dev); 690 + if (error) 691 + return error; 692 + 693 + if (!pm_runtime_status_suspended(dev)) { 694 + error = pm_generic_runtime_suspend(dev); 695 + if (error) 696 + return error; 697 + 698 + error = sysc_runtime_suspend(ddata->dev); 699 + if (error) 700 + return error; 701 + 702 + ddata->child_needs_resume = true; 703 + } 704 + 705 + return 0; 706 + } 707 + 708 + static int sysc_child_resume_noirq(struct device *dev) 709 + { 710 + struct sysc *ddata; 711 + int error; 712 + 713 + ddata = sysc_child_to_parent(dev); 714 + 715 + if (ddata->child_needs_resume) { 716 + ddata->child_needs_resume = false; 717 + 718 + error = sysc_runtime_resume(ddata->dev); 719 + if (error) 720 + dev_err(ddata->dev, 721 + "%s runtime resume error: %i\n", 722 + __func__, error); 723 + 724 + error = pm_generic_runtime_resume(dev); 725 + if (error) 726 + dev_err(ddata->dev, 727 + "%s generic runtime resume: %i\n", 728 + __func__, error); 729 + } 730 + 731 + return pm_generic_resume_noirq(dev); 732 + } 733 + #endif 734 + 735 + struct dev_pm_domain sysc_child_pm_domain = { 736 + .ops = { 737 + SET_RUNTIME_PM_OPS(sysc_child_runtime_suspend, 738 + sysc_child_runtime_resume, 739 + NULL) 740 + USE_PLATFORM_PM_SLEEP_OPS 741 + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(sysc_child_suspend_noirq, 742 + sysc_child_resume_noirq) 743 + } 744 + }; 745 + 746 + /** 747 + * sysc_legacy_idle_quirk - handle children in omap_device compatible way 748 + * @ddata: device driver data 749 + * @child: child device driver 750 + * 751 + * Allow idle for child devices as done with _od_runtime_suspend(). 752 + * Otherwise many child devices will not idle because of the permanent 753 + * parent usecount set in pm_runtime_irq_safe(). 754 + * 755 + * Note that the long term solution is to just modify the child device 756 + * drivers to not set pm_runtime_irq_safe() and then this can be just 757 + * dropped. 758 + */ 759 + static void sysc_legacy_idle_quirk(struct sysc *ddata, struct device *child) 760 + { 761 + if (!ddata->legacy_mode) 762 + return; 763 + 764 + if (ddata->cfg.quirks & SYSC_QUIRK_LEGACY_IDLE) 765 + dev_pm_domain_set(child, &sysc_child_pm_domain); 766 + } 767 + 768 + static int sysc_notifier_call(struct notifier_block *nb, 769 + unsigned long event, void *device) 770 + { 771 + struct device *dev = device; 772 + struct sysc *ddata; 773 + int error; 774 + 775 + ddata = sysc_child_to_parent(dev); 776 + if (!ddata) 777 + return NOTIFY_DONE; 778 + 779 + switch (event) { 780 + case BUS_NOTIFY_ADD_DEVICE: 781 + error = sysc_child_add_fck(ddata, dev); 782 + if (error && error != -EEXIST) 783 + dev_warn(ddata->dev, "could not add %s fck: %i\n", 784 + dev_name(dev), error); 785 + sysc_legacy_idle_quirk(ddata, dev); 786 + break; 787 + default: 788 + break; 789 + } 790 + 791 + return NOTIFY_DONE; 792 + } 793 + 794 + static struct notifier_block sysc_nb = { 795 + .notifier_call = sysc_notifier_call, 796 + }; 812 797 813 798 /* Device tree configured quirks */ 814 799 struct sysc_dts_quirk { ··· 1192 797 .type = TI_SYSC_OMAP34XX_SR, 1193 798 .sysc_mask = SYSC_OMAP2_CLOCKACTIVITY, 1194 799 .regbits = &sysc_regbits_omap34xx_sr, 1195 - .mod_quirks = SYSC_QUIRK_USE_CLOCKACT | SYSC_QUIRK_UNCACHED, 800 + .mod_quirks = SYSC_QUIRK_USE_CLOCKACT | SYSC_QUIRK_UNCACHED | 801 + SYSC_QUIRK_LEGACY_IDLE, 1196 802 }; 1197 803 1198 804 /* ··· 1214 818 .type = TI_SYSC_OMAP36XX_SR, 1215 819 .sysc_mask = SYSC_OMAP3_SR_ENAWAKEUP, 1216 820 .regbits = &sysc_regbits_omap36xx_sr, 1217 - .mod_quirks = SYSC_QUIRK_UNCACHED, 821 + .mod_quirks = SYSC_QUIRK_UNCACHED | SYSC_QUIRK_LEGACY_IDLE, 1218 822 }; 1219 823 1220 824 static const struct sysc_capabilities sysc_omap4_sr = { 1221 825 .type = TI_SYSC_OMAP4_SR, 1222 826 .regbits = &sysc_regbits_omap36xx_sr, 827 + .mod_quirks = SYSC_QUIRK_LEGACY_IDLE, 1223 828 }; 1224 829 1225 830 /* ··· 1262 865 .regbits = &sysc_regbits_omap4_usb_host_fs, 1263 866 }; 1264 867 868 + static int sysc_init_pdata(struct sysc *ddata) 869 + { 870 + struct ti_sysc_platform_data *pdata = dev_get_platdata(ddata->dev); 871 + struct ti_sysc_module_data mdata; 872 + int error = 0; 873 + 874 + if (!pdata || !ddata->legacy_mode) 875 + return 0; 876 + 877 + mdata.name = ddata->legacy_mode; 878 + mdata.module_pa = ddata->module_pa; 879 + mdata.module_size = ddata->module_size; 880 + mdata.offsets = ddata->offsets; 881 + mdata.nr_offsets = SYSC_MAX_REGS; 882 + mdata.cap = ddata->cap; 883 + mdata.cfg = &ddata->cfg; 884 + 885 + if (!pdata->init_module) 886 + return -ENODEV; 887 + 888 + error = pdata->init_module(ddata->dev, &mdata, &ddata->cookie); 889 + if (error == -EEXIST) 890 + error = 0; 891 + 892 + return error; 893 + } 894 + 1265 895 static int sysc_init_match(struct sysc *ddata) 1266 896 { 1267 897 const struct sysc_capabilities *cap; ··· 1304 880 return 0; 1305 881 } 1306 882 883 + static void ti_sysc_idle(struct work_struct *work) 884 + { 885 + struct sysc *ddata; 886 + 887 + ddata = container_of(work, struct sysc, idle_work.work); 888 + 889 + if (pm_runtime_active(ddata->dev)) 890 + pm_runtime_put_sync(ddata->dev); 891 + } 892 + 1307 893 static int sysc_probe(struct platform_device *pdev) 1308 894 { 895 + struct ti_sysc_platform_data *pdata = dev_get_platdata(&pdev->dev); 1309 896 struct sysc *ddata; 1310 897 int error; 1311 898 ··· 1355 920 if (error) 1356 921 goto unprepare; 1357 922 923 + error = sysc_init_pdata(ddata); 924 + if (error) 925 + goto unprepare; 926 + 1358 927 pm_runtime_enable(ddata->dev); 1359 928 1360 929 error = sysc_init_module(ddata); ··· 1372 933 goto unprepare; 1373 934 } 1374 935 1375 - pm_runtime_use_autosuspend(ddata->dev); 1376 - 1377 936 sysc_show_registers(ddata); 1378 937 938 + ddata->dev->type = &sysc_device_type; 1379 939 error = of_platform_populate(ddata->dev->of_node, 1380 - NULL, NULL, ddata->dev); 940 + NULL, pdata ? pdata->auxdata : NULL, 941 + ddata->dev); 1381 942 if (error) 1382 943 goto err; 1383 944 1384 - pm_runtime_mark_last_busy(ddata->dev); 1385 - pm_runtime_put_autosuspend(ddata->dev); 945 + INIT_DELAYED_WORK(&ddata->idle_work, ti_sysc_idle); 946 + 947 + /* At least earlycon won't survive without deferred idle */ 948 + if (ddata->cfg.quirks & (SYSC_QUIRK_NO_IDLE_ON_INIT | 949 + SYSC_QUIRK_NO_RESET_ON_INIT)) { 950 + schedule_delayed_work(&ddata->idle_work, 3000); 951 + } else { 952 + pm_runtime_put(&pdev->dev); 953 + } 1386 954 1387 955 return 0; 1388 956 1389 957 err: 1390 - pm_runtime_dont_use_autosuspend(&pdev->dev); 1391 958 pm_runtime_put_sync(&pdev->dev); 1392 959 pm_runtime_disable(&pdev->dev); 1393 960 unprepare: ··· 1407 962 struct sysc *ddata = platform_get_drvdata(pdev); 1408 963 int error; 1409 964 965 + cancel_delayed_work_sync(&ddata->idle_work); 966 + 1410 967 error = pm_runtime_get_sync(ddata->dev); 1411 968 if (error < 0) { 1412 969 pm_runtime_put_noidle(ddata->dev); ··· 1418 971 1419 972 of_platform_depopulate(&pdev->dev); 1420 973 1421 - pm_runtime_dont_use_autosuspend(&pdev->dev); 1422 974 pm_runtime_put_sync(&pdev->dev); 1423 975 pm_runtime_disable(&pdev->dev); 1424 976 ··· 1454 1008 .pm = &sysc_pm_ops, 1455 1009 }, 1456 1010 }; 1457 - module_platform_driver(sysc_driver); 1011 + 1012 + static int __init sysc_init(void) 1013 + { 1014 + bus_register_notifier(&platform_bus_type, &sysc_nb); 1015 + 1016 + return platform_driver_register(&sysc_driver); 1017 + } 1018 + module_init(sysc_init); 1019 + 1020 + static void __exit sysc_exit(void) 1021 + { 1022 + bus_unregister_notifier(&platform_bus_type, &sysc_nb); 1023 + platform_driver_unregister(&sysc_driver); 1024 + } 1025 + module_exit(sysc_exit); 1458 1026 1459 1027 MODULE_DESCRIPTION("TI sysc interconnect target driver"); 1460 1028 MODULE_LICENSE("GPL v2");
+3
drivers/clocksource/Kconfig
··· 21 21 config I8253_LOCK 22 22 bool 23 23 24 + config OMAP_DM_TIMER 25 + bool 26 + 24 27 config CLKBLD_I8253 25 28 def_bool y if CLKSRC_I8253 || CLKEVT_I8253 || I8253_LOCK 26 29
+1
drivers/clocksource/Makefile
··· 16 16 obj-$(CONFIG_CLKBLD_I8253) += i8253.o 17 17 obj-$(CONFIG_CLKSRC_MMIO) += mmio.o 18 18 obj-$(CONFIG_DIGICOLOR_TIMER) += timer-digicolor.o 19 + obj-$(CONFIG_OMAP_DM_TIMER) += timer-ti-dm.o 19 20 obj-$(CONFIG_DW_APB_TIMER) += dw_apb_timer.o 20 21 obj-$(CONFIG_DW_APB_TIMER_OF) += dw_apb_timer_of.o 21 22 obj-$(CONFIG_FTTMR010_TIMER) += timer-fttmr010.o
-11
drivers/mtd/nand/Kconfig
··· 313 313 Enables support for NAND Flash / Smart Media Card interface 314 314 on Atmel AT91 processors. 315 315 316 - config MTD_NAND_PXA3xx 317 - tristate "NAND support on PXA3xx and Armada 370/XP" 318 - depends on !MTD_NAND_MARVELL 319 - depends on PXA3xx || ARCH_MMP || PLAT_ORION || ARCH_MVEBU 320 - help 321 - 322 - This enables the driver for the NAND flash device found on 323 - PXA3xx processors (NFCv1) and also on 32-bit Armada 324 - platforms (XP, 370, 375, 38x, 39x) and 64-bit Armada 325 - platforms (7K, 8K) (NFCv2). 326 - 327 316 config MTD_NAND_MARVELL 328 317 tristate "NAND controller support on Marvell boards" 329 318 depends on PXA3xx || ARCH_MMP || PLAT_ORION || ARCH_MVEBU || \
-1
drivers/mtd/nand/Makefile
··· 31 31 obj-$(CONFIG_MTD_NAND_OMAP2) += omap2_nand.o 32 32 obj-$(CONFIG_MTD_NAND_OMAP_BCH_BUILD) += omap_elm.o 33 33 obj-$(CONFIG_MTD_NAND_CM_X270) += cmx270_nand.o 34 - obj-$(CONFIG_MTD_NAND_PXA3xx) += pxa3xx_nand.o 35 34 obj-$(CONFIG_MTD_NAND_MARVELL) += marvell_nand.o 36 35 obj-$(CONFIG_MTD_NAND_TMIO) += tmio_nand.o 37 36 obj-$(CONFIG_MTD_NAND_PLATFORM) += plat_nand.o
+1 -2
drivers/mtd/nand/marvell_nand.c
··· 2520 2520 2521 2521 if (pdata) 2522 2522 /* Legacy bindings support only one chip */ 2523 - ret = mtd_device_register(mtd, pdata->parts[0], 2524 - pdata->nr_parts[0]); 2523 + ret = mtd_device_register(mtd, pdata->parts, pdata->nr_parts); 2525 2524 else 2526 2525 ret = mtd_device_register(mtd, NULL, 0); 2527 2526 if (ret) {
-2105
drivers/mtd/nand/pxa3xx_nand.c
··· 1 - /* 2 - * drivers/mtd/nand/pxa3xx_nand.c 3 - * 4 - * Copyright © 2005 Intel Corporation 5 - * Copyright © 2006 Marvell International Ltd. 6 - * 7 - * This program is free software; you can redistribute it and/or modify 8 - * it under the terms of the GNU General Public License version 2 as 9 - * published by the Free Software Foundation. 10 - * 11 - * See Documentation/mtd/nand/pxa3xx-nand.txt for more details. 12 - */ 13 - 14 - #include <linux/kernel.h> 15 - #include <linux/module.h> 16 - #include <linux/interrupt.h> 17 - #include <linux/platform_device.h> 18 - #include <linux/dmaengine.h> 19 - #include <linux/dma-mapping.h> 20 - #include <linux/dma/pxa-dma.h> 21 - #include <linux/delay.h> 22 - #include <linux/clk.h> 23 - #include <linux/mtd/mtd.h> 24 - #include <linux/mtd/rawnand.h> 25 - #include <linux/mtd/partitions.h> 26 - #include <linux/io.h> 27 - #include <linux/iopoll.h> 28 - #include <linux/irq.h> 29 - #include <linux/slab.h> 30 - #include <linux/of.h> 31 - #include <linux/of_device.h> 32 - #include <linux/platform_data/mtd-nand-pxa3xx.h> 33 - #include <linux/mfd/syscon.h> 34 - #include <linux/regmap.h> 35 - 36 - #define CHIP_DELAY_TIMEOUT msecs_to_jiffies(200) 37 - #define NAND_STOP_DELAY msecs_to_jiffies(40) 38 - #define PAGE_CHUNK_SIZE (2048) 39 - 40 - /* 41 - * Define a buffer size for the initial command that detects the flash device: 42 - * STATUS, READID and PARAM. 43 - * ONFI param page is 256 bytes, and there are three redundant copies 44 - * to be read. JEDEC param page is 512 bytes, and there are also three 45 - * redundant copies to be read. 46 - * Hence this buffer should be at least 512 x 3. Let's pick 2048. 47 - */ 48 - #define INIT_BUFFER_SIZE 2048 49 - 50 - /* System control register and bit to enable NAND on some SoCs */ 51 - #define GENCONF_SOC_DEVICE_MUX 0x208 52 - #define GENCONF_SOC_DEVICE_MUX_NFC_EN BIT(0) 53 - 54 - /* registers and bit definitions */ 55 - #define NDCR (0x00) /* Control register */ 56 - #define NDTR0CS0 (0x04) /* Timing Parameter 0 for CS0 */ 57 - #define NDTR1CS0 (0x0C) /* Timing Parameter 1 for CS0 */ 58 - #define NDSR (0x14) /* Status Register */ 59 - #define NDPCR (0x18) /* Page Count Register */ 60 - #define NDBDR0 (0x1C) /* Bad Block Register 0 */ 61 - #define NDBDR1 (0x20) /* Bad Block Register 1 */ 62 - #define NDECCCTRL (0x28) /* ECC control */ 63 - #define NDDB (0x40) /* Data Buffer */ 64 - #define NDCB0 (0x48) /* Command Buffer0 */ 65 - #define NDCB1 (0x4C) /* Command Buffer1 */ 66 - #define NDCB2 (0x50) /* Command Buffer2 */ 67 - 68 - #define NDCR_SPARE_EN (0x1 << 31) 69 - #define NDCR_ECC_EN (0x1 << 30) 70 - #define NDCR_DMA_EN (0x1 << 29) 71 - #define NDCR_ND_RUN (0x1 << 28) 72 - #define NDCR_DWIDTH_C (0x1 << 27) 73 - #define NDCR_DWIDTH_M (0x1 << 26) 74 - #define NDCR_PAGE_SZ (0x1 << 24) 75 - #define NDCR_NCSX (0x1 << 23) 76 - #define NDCR_ND_MODE (0x3 << 21) 77 - #define NDCR_NAND_MODE (0x0) 78 - #define NDCR_CLR_PG_CNT (0x1 << 20) 79 - #define NFCV1_NDCR_ARB_CNTL (0x1 << 19) 80 - #define NFCV2_NDCR_STOP_ON_UNCOR (0x1 << 19) 81 - #define NDCR_RD_ID_CNT_MASK (0x7 << 16) 82 - #define NDCR_RD_ID_CNT(x) (((x) << 16) & NDCR_RD_ID_CNT_MASK) 83 - 84 - #define NDCR_RA_START (0x1 << 15) 85 - #define NDCR_PG_PER_BLK (0x1 << 14) 86 - #define NDCR_ND_ARB_EN (0x1 << 12) 87 - #define NDCR_INT_MASK (0xFFF) 88 - 89 - #define NDSR_MASK (0xfff) 90 - #define NDSR_ERR_CNT_OFF (16) 91 - #define NDSR_ERR_CNT_MASK (0x1f) 92 - #define NDSR_ERR_CNT(sr) ((sr >> NDSR_ERR_CNT_OFF) & NDSR_ERR_CNT_MASK) 93 - #define NDSR_RDY (0x1 << 12) 94 - #define NDSR_FLASH_RDY (0x1 << 11) 95 - #define NDSR_CS0_PAGED (0x1 << 10) 96 - #define NDSR_CS1_PAGED (0x1 << 9) 97 - #define NDSR_CS0_CMDD (0x1 << 8) 98 - #define NDSR_CS1_CMDD (0x1 << 7) 99 - #define NDSR_CS0_BBD (0x1 << 6) 100 - #define NDSR_CS1_BBD (0x1 << 5) 101 - #define NDSR_UNCORERR (0x1 << 4) 102 - #define NDSR_CORERR (0x1 << 3) 103 - #define NDSR_WRDREQ (0x1 << 2) 104 - #define NDSR_RDDREQ (0x1 << 1) 105 - #define NDSR_WRCMDREQ (0x1) 106 - 107 - #define NDCB0_LEN_OVRD (0x1 << 28) 108 - #define NDCB0_ST_ROW_EN (0x1 << 26) 109 - #define NDCB0_AUTO_RS (0x1 << 25) 110 - #define NDCB0_CSEL (0x1 << 24) 111 - #define NDCB0_EXT_CMD_TYPE_MASK (0x7 << 29) 112 - #define NDCB0_EXT_CMD_TYPE(x) (((x) << 29) & NDCB0_EXT_CMD_TYPE_MASK) 113 - #define NDCB0_CMD_TYPE_MASK (0x7 << 21) 114 - #define NDCB0_CMD_TYPE(x) (((x) << 21) & NDCB0_CMD_TYPE_MASK) 115 - #define NDCB0_NC (0x1 << 20) 116 - #define NDCB0_DBC (0x1 << 19) 117 - #define NDCB0_ADDR_CYC_MASK (0x7 << 16) 118 - #define NDCB0_ADDR_CYC(x) (((x) << 16) & NDCB0_ADDR_CYC_MASK) 119 - #define NDCB0_CMD2_MASK (0xff << 8) 120 - #define NDCB0_CMD1_MASK (0xff) 121 - #define NDCB0_ADDR_CYC_SHIFT (16) 122 - 123 - #define EXT_CMD_TYPE_DISPATCH 6 /* Command dispatch */ 124 - #define EXT_CMD_TYPE_NAKED_RW 5 /* Naked read or Naked write */ 125 - #define EXT_CMD_TYPE_READ 4 /* Read */ 126 - #define EXT_CMD_TYPE_DISP_WR 4 /* Command dispatch with write */ 127 - #define EXT_CMD_TYPE_FINAL 3 /* Final command */ 128 - #define EXT_CMD_TYPE_LAST_RW 1 /* Last naked read/write */ 129 - #define EXT_CMD_TYPE_MONO 0 /* Monolithic read/write */ 130 - 131 - /* 132 - * This should be large enough to read 'ONFI' and 'JEDEC'. 133 - * Let's use 7 bytes, which is the maximum ID count supported 134 - * by the controller (see NDCR_RD_ID_CNT_MASK). 135 - */ 136 - #define READ_ID_BYTES 7 137 - 138 - /* macros for registers read/write */ 139 - #define nand_writel(info, off, val) \ 140 - do { \ 141 - dev_vdbg(&info->pdev->dev, \ 142 - "%s():%d nand_writel(0x%x, 0x%04x)\n", \ 143 - __func__, __LINE__, (val), (off)); \ 144 - writel_relaxed((val), (info)->mmio_base + (off)); \ 145 - } while (0) 146 - 147 - #define nand_readl(info, off) \ 148 - ({ \ 149 - unsigned int _v; \ 150 - _v = readl_relaxed((info)->mmio_base + (off)); \ 151 - dev_vdbg(&info->pdev->dev, \ 152 - "%s():%d nand_readl(0x%04x) = 0x%x\n", \ 153 - __func__, __LINE__, (off), _v); \ 154 - _v; \ 155 - }) 156 - 157 - /* error code and state */ 158 - enum { 159 - ERR_NONE = 0, 160 - ERR_DMABUSERR = -1, 161 - ERR_SENDCMD = -2, 162 - ERR_UNCORERR = -3, 163 - ERR_BBERR = -4, 164 - ERR_CORERR = -5, 165 - }; 166 - 167 - enum { 168 - STATE_IDLE = 0, 169 - STATE_PREPARED, 170 - STATE_CMD_HANDLE, 171 - STATE_DMA_READING, 172 - STATE_DMA_WRITING, 173 - STATE_DMA_DONE, 174 - STATE_PIO_READING, 175 - STATE_PIO_WRITING, 176 - STATE_CMD_DONE, 177 - STATE_READY, 178 - }; 179 - 180 - enum pxa3xx_nand_variant { 181 - PXA3XX_NAND_VARIANT_PXA, 182 - PXA3XX_NAND_VARIANT_ARMADA370, 183 - PXA3XX_NAND_VARIANT_ARMADA_8K, 184 - }; 185 - 186 - struct pxa3xx_nand_host { 187 - struct nand_chip chip; 188 - void *info_data; 189 - 190 - /* page size of attached chip */ 191 - int use_ecc; 192 - int cs; 193 - 194 - /* calculated from pxa3xx_nand_flash data */ 195 - unsigned int col_addr_cycles; 196 - unsigned int row_addr_cycles; 197 - }; 198 - 199 - struct pxa3xx_nand_info { 200 - struct nand_hw_control controller; 201 - struct platform_device *pdev; 202 - 203 - struct clk *clk; 204 - void __iomem *mmio_base; 205 - unsigned long mmio_phys; 206 - struct completion cmd_complete, dev_ready; 207 - 208 - unsigned int buf_start; 209 - unsigned int buf_count; 210 - unsigned int buf_size; 211 - unsigned int data_buff_pos; 212 - unsigned int oob_buff_pos; 213 - 214 - /* DMA information */ 215 - struct scatterlist sg; 216 - enum dma_data_direction dma_dir; 217 - struct dma_chan *dma_chan; 218 - dma_cookie_t dma_cookie; 219 - int drcmr_dat; 220 - 221 - unsigned char *data_buff; 222 - unsigned char *oob_buff; 223 - dma_addr_t data_buff_phys; 224 - int data_dma_ch; 225 - 226 - struct pxa3xx_nand_host *host[NUM_CHIP_SELECT]; 227 - unsigned int state; 228 - 229 - /* 230 - * This driver supports NFCv1 (as found in PXA SoC) 231 - * and NFCv2 (as found in Armada 370/XP SoC). 232 - */ 233 - enum pxa3xx_nand_variant variant; 234 - 235 - int cs; 236 - int use_ecc; /* use HW ECC ? */ 237 - int ecc_bch; /* using BCH ECC? */ 238 - int use_dma; /* use DMA ? */ 239 - int use_spare; /* use spare ? */ 240 - int need_wait; 241 - 242 - /* Amount of real data per full chunk */ 243 - unsigned int chunk_size; 244 - 245 - /* Amount of spare data per full chunk */ 246 - unsigned int spare_size; 247 - 248 - /* Number of full chunks (i.e chunk_size + spare_size) */ 249 - unsigned int nfullchunks; 250 - 251 - /* 252 - * Total number of chunks. If equal to nfullchunks, then there 253 - * are only full chunks. Otherwise, there is one last chunk of 254 - * size (last_chunk_size + last_spare_size) 255 - */ 256 - unsigned int ntotalchunks; 257 - 258 - /* Amount of real data in the last chunk */ 259 - unsigned int last_chunk_size; 260 - 261 - /* Amount of spare data in the last chunk */ 262 - unsigned int last_spare_size; 263 - 264 - unsigned int ecc_size; 265 - unsigned int ecc_err_cnt; 266 - unsigned int max_bitflips; 267 - int retcode; 268 - 269 - /* 270 - * Variables only valid during command 271 - * execution. step_chunk_size and step_spare_size is the 272 - * amount of real data and spare data in the current 273 - * chunk. cur_chunk is the current chunk being 274 - * read/programmed. 275 - */ 276 - unsigned int step_chunk_size; 277 - unsigned int step_spare_size; 278 - unsigned int cur_chunk; 279 - 280 - /* cached register value */ 281 - uint32_t reg_ndcr; 282 - uint32_t ndtr0cs0; 283 - uint32_t ndtr1cs0; 284 - 285 - /* generated NDCBx register values */ 286 - uint32_t ndcb0; 287 - uint32_t ndcb1; 288 - uint32_t ndcb2; 289 - uint32_t ndcb3; 290 - }; 291 - 292 - static bool use_dma = 1; 293 - module_param(use_dma, bool, 0444); 294 - MODULE_PARM_DESC(use_dma, "enable DMA for data transferring to/from NAND HW"); 295 - 296 - struct pxa3xx_nand_timing { 297 - unsigned int tCH; /* Enable signal hold time */ 298 - unsigned int tCS; /* Enable signal setup time */ 299 - unsigned int tWH; /* ND_nWE high duration */ 300 - unsigned int tWP; /* ND_nWE pulse time */ 301 - unsigned int tRH; /* ND_nRE high duration */ 302 - unsigned int tRP; /* ND_nRE pulse width */ 303 - unsigned int tR; /* ND_nWE high to ND_nRE low for read */ 304 - unsigned int tWHR; /* ND_nWE high to ND_nRE low for status read */ 305 - unsigned int tAR; /* ND_ALE low to ND_nRE low delay */ 306 - }; 307 - 308 - struct pxa3xx_nand_flash { 309 - uint32_t chip_id; 310 - unsigned int flash_width; /* Width of Flash memory (DWIDTH_M) */ 311 - unsigned int dfc_width; /* Width of flash controller(DWIDTH_C) */ 312 - struct pxa3xx_nand_timing *timing; /* NAND Flash timing */ 313 - }; 314 - 315 - static struct pxa3xx_nand_timing timing[] = { 316 - { 40, 80, 60, 100, 80, 100, 90000, 400, 40, }, 317 - { 10, 0, 20, 40, 30, 40, 11123, 110, 10, }, 318 - { 10, 25, 15, 25, 15, 30, 25000, 60, 10, }, 319 - { 10, 35, 15, 25, 15, 25, 25000, 60, 10, }, 320 - }; 321 - 322 - static struct pxa3xx_nand_flash builtin_flash_types[] = { 323 - { 0x46ec, 16, 16, &timing[1] }, 324 - { 0xdaec, 8, 8, &timing[1] }, 325 - { 0xd7ec, 8, 8, &timing[1] }, 326 - { 0xa12c, 8, 8, &timing[2] }, 327 - { 0xb12c, 16, 16, &timing[2] }, 328 - { 0xdc2c, 8, 8, &timing[2] }, 329 - { 0xcc2c, 16, 16, &timing[2] }, 330 - { 0xba20, 16, 16, &timing[3] }, 331 - }; 332 - 333 - static int pxa3xx_ooblayout_ecc(struct mtd_info *mtd, int section, 334 - struct mtd_oob_region *oobregion) 335 - { 336 - struct nand_chip *chip = mtd_to_nand(mtd); 337 - struct pxa3xx_nand_host *host = nand_get_controller_data(chip); 338 - struct pxa3xx_nand_info *info = host->info_data; 339 - int nchunks = mtd->writesize / info->chunk_size; 340 - 341 - if (section >= nchunks) 342 - return -ERANGE; 343 - 344 - oobregion->offset = ((info->ecc_size + info->spare_size) * section) + 345 - info->spare_size; 346 - oobregion->length = info->ecc_size; 347 - 348 - return 0; 349 - } 350 - 351 - static int pxa3xx_ooblayout_free(struct mtd_info *mtd, int section, 352 - struct mtd_oob_region *oobregion) 353 - { 354 - struct nand_chip *chip = mtd_to_nand(mtd); 355 - struct pxa3xx_nand_host *host = nand_get_controller_data(chip); 356 - struct pxa3xx_nand_info *info = host->info_data; 357 - int nchunks = mtd->writesize / info->chunk_size; 358 - 359 - if (section >= nchunks) 360 - return -ERANGE; 361 - 362 - if (!info->spare_size) 363 - return 0; 364 - 365 - oobregion->offset = section * (info->ecc_size + info->spare_size); 366 - oobregion->length = info->spare_size; 367 - if (!section) { 368 - /* 369 - * Bootrom looks in bytes 0 & 5 for bad blocks for the 370 - * 4KB page / 4bit BCH combination. 371 - */ 372 - if (mtd->writesize == 4096 && info->chunk_size == 2048) { 373 - oobregion->offset += 6; 374 - oobregion->length -= 6; 375 - } else { 376 - oobregion->offset += 2; 377 - oobregion->length -= 2; 378 - } 379 - } 380 - 381 - return 0; 382 - } 383 - 384 - static const struct mtd_ooblayout_ops pxa3xx_ooblayout_ops = { 385 - .ecc = pxa3xx_ooblayout_ecc, 386 - .free = pxa3xx_ooblayout_free, 387 - }; 388 - 389 - static u8 bbt_pattern[] = {'M', 'V', 'B', 'b', 't', '0' }; 390 - static u8 bbt_mirror_pattern[] = {'1', 't', 'b', 'B', 'V', 'M' }; 391 - 392 - static struct nand_bbt_descr bbt_main_descr = { 393 - .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE 394 - | NAND_BBT_2BIT | NAND_BBT_VERSION, 395 - .offs = 8, 396 - .len = 6, 397 - .veroffs = 14, 398 - .maxblocks = 8, /* Last 8 blocks in each chip */ 399 - .pattern = bbt_pattern 400 - }; 401 - 402 - static struct nand_bbt_descr bbt_mirror_descr = { 403 - .options = NAND_BBT_LASTBLOCK | NAND_BBT_CREATE | NAND_BBT_WRITE 404 - | NAND_BBT_2BIT | NAND_BBT_VERSION, 405 - .offs = 8, 406 - .len = 6, 407 - .veroffs = 14, 408 - .maxblocks = 8, /* Last 8 blocks in each chip */ 409 - .pattern = bbt_mirror_pattern 410 - }; 411 - 412 - #define NDTR0_tCH(c) (min((c), 7) << 19) 413 - #define NDTR0_tCS(c) (min((c), 7) << 16) 414 - #define NDTR0_tWH(c) (min((c), 7) << 11) 415 - #define NDTR0_tWP(c) (min((c), 7) << 8) 416 - #define NDTR0_tRH(c) (min((c), 7) << 3) 417 - #define NDTR0_tRP(c) (min((c), 7) << 0) 418 - 419 - #define NDTR1_tR(c) (min((c), 65535) << 16) 420 - #define NDTR1_tWHR(c) (min((c), 15) << 4) 421 - #define NDTR1_tAR(c) (min((c), 15) << 0) 422 - 423 - /* convert nano-seconds to nand flash controller clock cycles */ 424 - #define ns2cycle(ns, clk) (int)((ns) * (clk / 1000000) / 1000) 425 - 426 - static const struct of_device_id pxa3xx_nand_dt_ids[] = { 427 - { 428 - .compatible = "marvell,pxa3xx-nand", 429 - .data = (void *)PXA3XX_NAND_VARIANT_PXA, 430 - }, 431 - { 432 - .compatible = "marvell,armada370-nand", 433 - .data = (void *)PXA3XX_NAND_VARIANT_ARMADA370, 434 - }, 435 - { 436 - .compatible = "marvell,armada-8k-nand", 437 - .data = (void *)PXA3XX_NAND_VARIANT_ARMADA_8K, 438 - }, 439 - {} 440 - }; 441 - MODULE_DEVICE_TABLE(of, pxa3xx_nand_dt_ids); 442 - 443 - static enum pxa3xx_nand_variant 444 - pxa3xx_nand_get_variant(struct platform_device *pdev) 445 - { 446 - const struct of_device_id *of_id = 447 - of_match_device(pxa3xx_nand_dt_ids, &pdev->dev); 448 - if (!of_id) 449 - return PXA3XX_NAND_VARIANT_PXA; 450 - return (enum pxa3xx_nand_variant)of_id->data; 451 - } 452 - 453 - static void pxa3xx_nand_set_timing(struct pxa3xx_nand_host *host, 454 - const struct pxa3xx_nand_timing *t) 455 - { 456 - struct pxa3xx_nand_info *info = host->info_data; 457 - unsigned long nand_clk = clk_get_rate(info->clk); 458 - uint32_t ndtr0, ndtr1; 459 - 460 - ndtr0 = NDTR0_tCH(ns2cycle(t->tCH, nand_clk)) | 461 - NDTR0_tCS(ns2cycle(t->tCS, nand_clk)) | 462 - NDTR0_tWH(ns2cycle(t->tWH, nand_clk)) | 463 - NDTR0_tWP(ns2cycle(t->tWP, nand_clk)) | 464 - NDTR0_tRH(ns2cycle(t->tRH, nand_clk)) | 465 - NDTR0_tRP(ns2cycle(t->tRP, nand_clk)); 466 - 467 - ndtr1 = NDTR1_tR(ns2cycle(t->tR, nand_clk)) | 468 - NDTR1_tWHR(ns2cycle(t->tWHR, nand_clk)) | 469 - NDTR1_tAR(ns2cycle(t->tAR, nand_clk)); 470 - 471 - info->ndtr0cs0 = ndtr0; 472 - info->ndtr1cs0 = ndtr1; 473 - nand_writel(info, NDTR0CS0, ndtr0); 474 - nand_writel(info, NDTR1CS0, ndtr1); 475 - } 476 - 477 - static void pxa3xx_nand_set_sdr_timing(struct pxa3xx_nand_host *host, 478 - const struct nand_sdr_timings *t) 479 - { 480 - struct pxa3xx_nand_info *info = host->info_data; 481 - struct nand_chip *chip = &host->chip; 482 - unsigned long nand_clk = clk_get_rate(info->clk); 483 - uint32_t ndtr0, ndtr1; 484 - 485 - u32 tCH_min = DIV_ROUND_UP(t->tCH_min, 1000); 486 - u32 tCS_min = DIV_ROUND_UP(t->tCS_min, 1000); 487 - u32 tWH_min = DIV_ROUND_UP(t->tWH_min, 1000); 488 - u32 tWP_min = DIV_ROUND_UP(t->tWC_min - t->tWH_min, 1000); 489 - u32 tREH_min = DIV_ROUND_UP(t->tREH_min, 1000); 490 - u32 tRP_min = DIV_ROUND_UP(t->tRC_min - t->tREH_min, 1000); 491 - u32 tR = chip->chip_delay * 1000; 492 - u32 tWHR_min = DIV_ROUND_UP(t->tWHR_min, 1000); 493 - u32 tAR_min = DIV_ROUND_UP(t->tAR_min, 1000); 494 - 495 - /* fallback to a default value if tR = 0 */ 496 - if (!tR) 497 - tR = 20000; 498 - 499 - ndtr0 = NDTR0_tCH(ns2cycle(tCH_min, nand_clk)) | 500 - NDTR0_tCS(ns2cycle(tCS_min, nand_clk)) | 501 - NDTR0_tWH(ns2cycle(tWH_min, nand_clk)) | 502 - NDTR0_tWP(ns2cycle(tWP_min, nand_clk)) | 503 - NDTR0_tRH(ns2cycle(tREH_min, nand_clk)) | 504 - NDTR0_tRP(ns2cycle(tRP_min, nand_clk)); 505 - 506 - ndtr1 = NDTR1_tR(ns2cycle(tR, nand_clk)) | 507 - NDTR1_tWHR(ns2cycle(tWHR_min, nand_clk)) | 508 - NDTR1_tAR(ns2cycle(tAR_min, nand_clk)); 509 - 510 - info->ndtr0cs0 = ndtr0; 511 - info->ndtr1cs0 = ndtr1; 512 - nand_writel(info, NDTR0CS0, ndtr0); 513 - nand_writel(info, NDTR1CS0, ndtr1); 514 - } 515 - 516 - static int pxa3xx_nand_init_timings_compat(struct pxa3xx_nand_host *host, 517 - unsigned int *flash_width, 518 - unsigned int *dfc_width) 519 - { 520 - struct nand_chip *chip = &host->chip; 521 - struct pxa3xx_nand_info *info = host->info_data; 522 - const struct pxa3xx_nand_flash *f = NULL; 523 - int i, id, ntypes; 524 - u8 idbuf[2]; 525 - 526 - ntypes = ARRAY_SIZE(builtin_flash_types); 527 - 528 - nand_readid_op(chip, 0, idbuf, sizeof(idbuf)); 529 - id = idbuf[0] | (idbuf[1] << 8); 530 - 531 - for (i = 0; i < ntypes; i++) { 532 - f = &builtin_flash_types[i]; 533 - 534 - if (f->chip_id == id) 535 - break; 536 - } 537 - 538 - if (i == ntypes) { 539 - dev_err(&info->pdev->dev, "Error: timings not found\n"); 540 - return -EINVAL; 541 - } 542 - 543 - pxa3xx_nand_set_timing(host, f->timing); 544 - 545 - *flash_width = f->flash_width; 546 - *dfc_width = f->dfc_width; 547 - 548 - return 0; 549 - } 550 - 551 - static int pxa3xx_nand_init_timings_onfi(struct pxa3xx_nand_host *host, 552 - int mode) 553 - { 554 - const struct nand_sdr_timings *timings; 555 - 556 - mode = fls(mode) - 1; 557 - if (mode < 0) 558 - mode = 0; 559 - 560 - timings = onfi_async_timing_mode_to_sdr_timings(mode); 561 - if (IS_ERR(timings)) 562 - return PTR_ERR(timings); 563 - 564 - pxa3xx_nand_set_sdr_timing(host, timings); 565 - 566 - return 0; 567 - } 568 - 569 - static int pxa3xx_nand_init(struct pxa3xx_nand_host *host) 570 - { 571 - struct nand_chip *chip = &host->chip; 572 - struct pxa3xx_nand_info *info = host->info_data; 573 - unsigned int flash_width = 0, dfc_width = 0; 574 - int mode, err; 575 - 576 - mode = onfi_get_async_timing_mode(chip); 577 - if (mode == ONFI_TIMING_MODE_UNKNOWN) { 578 - err = pxa3xx_nand_init_timings_compat(host, &flash_width, 579 - &dfc_width); 580 - if (err) 581 - return err; 582 - 583 - if (flash_width == 16) { 584 - info->reg_ndcr |= NDCR_DWIDTH_M; 585 - chip->options |= NAND_BUSWIDTH_16; 586 - } 587 - 588 - info->reg_ndcr |= (dfc_width == 16) ? NDCR_DWIDTH_C : 0; 589 - } else { 590 - err = pxa3xx_nand_init_timings_onfi(host, mode); 591 - if (err) 592 - return err; 593 - } 594 - 595 - return 0; 596 - } 597 - 598 - /** 599 - * NOTE: it is a must to set ND_RUN firstly, then write 600 - * command buffer, otherwise, it does not work. 601 - * We enable all the interrupt at the same time, and 602 - * let pxa3xx_nand_irq to handle all logic. 603 - */ 604 - static void pxa3xx_nand_start(struct pxa3xx_nand_info *info) 605 - { 606 - uint32_t ndcr; 607 - 608 - ndcr = info->reg_ndcr; 609 - 610 - if (info->use_ecc) { 611 - ndcr |= NDCR_ECC_EN; 612 - if (info->ecc_bch) 613 - nand_writel(info, NDECCCTRL, 0x1); 614 - } else { 615 - ndcr &= ~NDCR_ECC_EN; 616 - if (info->ecc_bch) 617 - nand_writel(info, NDECCCTRL, 0x0); 618 - } 619 - 620 - if (info->use_dma) 621 - ndcr |= NDCR_DMA_EN; 622 - else 623 - ndcr &= ~NDCR_DMA_EN; 624 - 625 - if (info->use_spare) 626 - ndcr |= NDCR_SPARE_EN; 627 - else 628 - ndcr &= ~NDCR_SPARE_EN; 629 - 630 - ndcr |= NDCR_ND_RUN; 631 - 632 - /* clear status bits and run */ 633 - nand_writel(info, NDSR, NDSR_MASK); 634 - nand_writel(info, NDCR, 0); 635 - nand_writel(info, NDCR, ndcr); 636 - } 637 - 638 - static void pxa3xx_nand_stop(struct pxa3xx_nand_info *info) 639 - { 640 - uint32_t ndcr; 641 - int timeout = NAND_STOP_DELAY; 642 - 643 - /* wait RUN bit in NDCR become 0 */ 644 - ndcr = nand_readl(info, NDCR); 645 - while ((ndcr & NDCR_ND_RUN) && (timeout-- > 0)) { 646 - ndcr = nand_readl(info, NDCR); 647 - udelay(1); 648 - } 649 - 650 - if (timeout <= 0) { 651 - ndcr &= ~NDCR_ND_RUN; 652 - nand_writel(info, NDCR, ndcr); 653 - } 654 - if (info->dma_chan) 655 - dmaengine_terminate_all(info->dma_chan); 656 - 657 - /* clear status bits */ 658 - nand_writel(info, NDSR, NDSR_MASK); 659 - } 660 - 661 - static void __maybe_unused 662 - enable_int(struct pxa3xx_nand_info *info, uint32_t int_mask) 663 - { 664 - uint32_t ndcr; 665 - 666 - ndcr = nand_readl(info, NDCR); 667 - nand_writel(info, NDCR, ndcr & ~int_mask); 668 - } 669 - 670 - static void disable_int(struct pxa3xx_nand_info *info, uint32_t int_mask) 671 - { 672 - uint32_t ndcr; 673 - 674 - ndcr = nand_readl(info, NDCR); 675 - nand_writel(info, NDCR, ndcr | int_mask); 676 - } 677 - 678 - static void drain_fifo(struct pxa3xx_nand_info *info, void *data, int len) 679 - { 680 - if (info->ecc_bch) { 681 - u32 val; 682 - int ret; 683 - 684 - /* 685 - * According to the datasheet, when reading from NDDB 686 - * with BCH enabled, after each 32 bytes reads, we 687 - * have to make sure that the NDSR.RDDREQ bit is set. 688 - * 689 - * Drain the FIFO 8 32 bits reads at a time, and skip 690 - * the polling on the last read. 691 - */ 692 - while (len > 8) { 693 - ioread32_rep(info->mmio_base + NDDB, data, 8); 694 - 695 - ret = readl_relaxed_poll_timeout(info->mmio_base + NDSR, val, 696 - val & NDSR_RDDREQ, 1000, 5000); 697 - if (ret) { 698 - dev_err(&info->pdev->dev, 699 - "Timeout on RDDREQ while draining the FIFO\n"); 700 - return; 701 - } 702 - 703 - data += 32; 704 - len -= 8; 705 - } 706 - } 707 - 708 - ioread32_rep(info->mmio_base + NDDB, data, len); 709 - } 710 - 711 - static void handle_data_pio(struct pxa3xx_nand_info *info) 712 - { 713 - switch (info->state) { 714 - case STATE_PIO_WRITING: 715 - if (info->step_chunk_size) 716 - writesl(info->mmio_base + NDDB, 717 - info->data_buff + info->data_buff_pos, 718 - DIV_ROUND_UP(info->step_chunk_size, 4)); 719 - 720 - if (info->step_spare_size) 721 - writesl(info->mmio_base + NDDB, 722 - info->oob_buff + info->oob_buff_pos, 723 - DIV_ROUND_UP(info->step_spare_size, 4)); 724 - break; 725 - case STATE_PIO_READING: 726 - if (info->step_chunk_size) 727 - drain_fifo(info, 728 - info->data_buff + info->data_buff_pos, 729 - DIV_ROUND_UP(info->step_chunk_size, 4)); 730 - 731 - if (info->step_spare_size) 732 - drain_fifo(info, 733 - info->oob_buff + info->oob_buff_pos, 734 - DIV_ROUND_UP(info->step_spare_size, 4)); 735 - break; 736 - default: 737 - dev_err(&info->pdev->dev, "%s: invalid state %d\n", __func__, 738 - info->state); 739 - BUG(); 740 - } 741 - 742 - /* Update buffer pointers for multi-page read/write */ 743 - info->data_buff_pos += info->step_chunk_size; 744 - info->oob_buff_pos += info->step_spare_size; 745 - } 746 - 747 - static void pxa3xx_nand_data_dma_irq(void *data) 748 - { 749 - struct pxa3xx_nand_info *info = data; 750 - struct dma_tx_state state; 751 - enum dma_status status; 752 - 753 - status = dmaengine_tx_status(info->dma_chan, info->dma_cookie, &state); 754 - if (likely(status == DMA_COMPLETE)) { 755 - info->state = STATE_DMA_DONE; 756 - } else { 757 - dev_err(&info->pdev->dev, "DMA error on data channel\n"); 758 - info->retcode = ERR_DMABUSERR; 759 - } 760 - dma_unmap_sg(info->dma_chan->device->dev, &info->sg, 1, info->dma_dir); 761 - 762 - nand_writel(info, NDSR, NDSR_WRDREQ | NDSR_RDDREQ); 763 - enable_int(info, NDCR_INT_MASK); 764 - } 765 - 766 - static void start_data_dma(struct pxa3xx_nand_info *info) 767 - { 768 - enum dma_transfer_direction direction; 769 - struct dma_async_tx_descriptor *tx; 770 - 771 - switch (info->state) { 772 - case STATE_DMA_WRITING: 773 - info->dma_dir = DMA_TO_DEVICE; 774 - direction = DMA_MEM_TO_DEV; 775 - break; 776 - case STATE_DMA_READING: 777 - info->dma_dir = DMA_FROM_DEVICE; 778 - direction = DMA_DEV_TO_MEM; 779 - break; 780 - default: 781 - dev_err(&info->pdev->dev, "%s: invalid state %d\n", __func__, 782 - info->state); 783 - BUG(); 784 - } 785 - info->sg.length = info->chunk_size; 786 - if (info->use_spare) 787 - info->sg.length += info->spare_size + info->ecc_size; 788 - dma_map_sg(info->dma_chan->device->dev, &info->sg, 1, info->dma_dir); 789 - 790 - tx = dmaengine_prep_slave_sg(info->dma_chan, &info->sg, 1, direction, 791 - DMA_PREP_INTERRUPT); 792 - if (!tx) { 793 - dev_err(&info->pdev->dev, "prep_slave_sg() failed\n"); 794 - return; 795 - } 796 - tx->callback = pxa3xx_nand_data_dma_irq; 797 - tx->callback_param = info; 798 - info->dma_cookie = dmaengine_submit(tx); 799 - dma_async_issue_pending(info->dma_chan); 800 - dev_dbg(&info->pdev->dev, "%s(dir=%d cookie=%x size=%u)\n", 801 - __func__, direction, info->dma_cookie, info->sg.length); 802 - } 803 - 804 - static irqreturn_t pxa3xx_nand_irq_thread(int irq, void *data) 805 - { 806 - struct pxa3xx_nand_info *info = data; 807 - 808 - handle_data_pio(info); 809 - 810 - info->state = STATE_CMD_DONE; 811 - nand_writel(info, NDSR, NDSR_WRDREQ | NDSR_RDDREQ); 812 - 813 - return IRQ_HANDLED; 814 - } 815 - 816 - static irqreturn_t pxa3xx_nand_irq(int irq, void *devid) 817 - { 818 - struct pxa3xx_nand_info *info = devid; 819 - unsigned int status, is_completed = 0, is_ready = 0; 820 - unsigned int ready, cmd_done; 821 - irqreturn_t ret = IRQ_HANDLED; 822 - 823 - if (info->cs == 0) { 824 - ready = NDSR_FLASH_RDY; 825 - cmd_done = NDSR_CS0_CMDD; 826 - } else { 827 - ready = NDSR_RDY; 828 - cmd_done = NDSR_CS1_CMDD; 829 - } 830 - 831 - status = nand_readl(info, NDSR); 832 - 833 - if (status & NDSR_UNCORERR) 834 - info->retcode = ERR_UNCORERR; 835 - if (status & NDSR_CORERR) { 836 - info->retcode = ERR_CORERR; 837 - if ((info->variant == PXA3XX_NAND_VARIANT_ARMADA370 || 838 - info->variant == PXA3XX_NAND_VARIANT_ARMADA_8K) && 839 - info->ecc_bch) 840 - info->ecc_err_cnt = NDSR_ERR_CNT(status); 841 - else 842 - info->ecc_err_cnt = 1; 843 - 844 - /* 845 - * Each chunk composing a page is corrected independently, 846 - * and we need to store maximum number of corrected bitflips 847 - * to return it to the MTD layer in ecc.read_page(). 848 - */ 849 - info->max_bitflips = max_t(unsigned int, 850 - info->max_bitflips, 851 - info->ecc_err_cnt); 852 - } 853 - if (status & (NDSR_RDDREQ | NDSR_WRDREQ)) { 854 - /* whether use dma to transfer data */ 855 - if (info->use_dma) { 856 - disable_int(info, NDCR_INT_MASK); 857 - info->state = (status & NDSR_RDDREQ) ? 858 - STATE_DMA_READING : STATE_DMA_WRITING; 859 - start_data_dma(info); 860 - goto NORMAL_IRQ_EXIT; 861 - } else { 862 - info->state = (status & NDSR_RDDREQ) ? 863 - STATE_PIO_READING : STATE_PIO_WRITING; 864 - ret = IRQ_WAKE_THREAD; 865 - goto NORMAL_IRQ_EXIT; 866 - } 867 - } 868 - if (status & cmd_done) { 869 - info->state = STATE_CMD_DONE; 870 - is_completed = 1; 871 - } 872 - if (status & ready) { 873 - info->state = STATE_READY; 874 - is_ready = 1; 875 - } 876 - 877 - /* 878 - * Clear all status bit before issuing the next command, which 879 - * can and will alter the status bits and will deserve a new 880 - * interrupt on its own. This lets the controller exit the IRQ 881 - */ 882 - nand_writel(info, NDSR, status); 883 - 884 - if (status & NDSR_WRCMDREQ) { 885 - status &= ~NDSR_WRCMDREQ; 886 - info->state = STATE_CMD_HANDLE; 887 - 888 - /* 889 - * Command buffer registers NDCB{0-2} (and optionally NDCB3) 890 - * must be loaded by writing directly either 12 or 16 891 - * bytes directly to NDCB0, four bytes at a time. 892 - * 893 - * Direct write access to NDCB1, NDCB2 and NDCB3 is ignored 894 - * but each NDCBx register can be read. 895 - */ 896 - nand_writel(info, NDCB0, info->ndcb0); 897 - nand_writel(info, NDCB0, info->ndcb1); 898 - nand_writel(info, NDCB0, info->ndcb2); 899 - 900 - /* NDCB3 register is available in NFCv2 (Armada 370/XP SoC) */ 901 - if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370 || 902 - info->variant == PXA3XX_NAND_VARIANT_ARMADA_8K) 903 - nand_writel(info, NDCB0, info->ndcb3); 904 - } 905 - 906 - if (is_completed) 907 - complete(&info->cmd_complete); 908 - if (is_ready) 909 - complete(&info->dev_ready); 910 - NORMAL_IRQ_EXIT: 911 - return ret; 912 - } 913 - 914 - static inline int is_buf_blank(uint8_t *buf, size_t len) 915 - { 916 - for (; len > 0; len--) 917 - if (*buf++ != 0xff) 918 - return 0; 919 - return 1; 920 - } 921 - 922 - static void set_command_address(struct pxa3xx_nand_info *info, 923 - unsigned int page_size, uint16_t column, int page_addr) 924 - { 925 - /* small page addr setting */ 926 - if (page_size < PAGE_CHUNK_SIZE) { 927 - info->ndcb1 = ((page_addr & 0xFFFFFF) << 8) 928 - | (column & 0xFF); 929 - 930 - info->ndcb2 = 0; 931 - } else { 932 - info->ndcb1 = ((page_addr & 0xFFFF) << 16) 933 - | (column & 0xFFFF); 934 - 935 - if (page_addr & 0xFF0000) 936 - info->ndcb2 = (page_addr & 0xFF0000) >> 16; 937 - else 938 - info->ndcb2 = 0; 939 - } 940 - } 941 - 942 - static void prepare_start_command(struct pxa3xx_nand_info *info, int command) 943 - { 944 - struct pxa3xx_nand_host *host = info->host[info->cs]; 945 - struct mtd_info *mtd = nand_to_mtd(&host->chip); 946 - 947 - /* reset data and oob column point to handle data */ 948 - info->buf_start = 0; 949 - info->buf_count = 0; 950 - info->data_buff_pos = 0; 951 - info->oob_buff_pos = 0; 952 - info->step_chunk_size = 0; 953 - info->step_spare_size = 0; 954 - info->cur_chunk = 0; 955 - info->use_ecc = 0; 956 - info->use_spare = 1; 957 - info->retcode = ERR_NONE; 958 - info->ecc_err_cnt = 0; 959 - info->ndcb3 = 0; 960 - info->need_wait = 0; 961 - 962 - switch (command) { 963 - case NAND_CMD_READ0: 964 - case NAND_CMD_READOOB: 965 - case NAND_CMD_PAGEPROG: 966 - info->use_ecc = 1; 967 - break; 968 - case NAND_CMD_PARAM: 969 - info->use_spare = 0; 970 - break; 971 - default: 972 - info->ndcb1 = 0; 973 - info->ndcb2 = 0; 974 - break; 975 - } 976 - 977 - /* 978 - * If we are about to issue a read command, or about to set 979 - * the write address, then clean the data buffer. 980 - */ 981 - if (command == NAND_CMD_READ0 || 982 - command == NAND_CMD_READOOB || 983 - command == NAND_CMD_SEQIN) { 984 - 985 - info->buf_count = mtd->writesize + mtd->oobsize; 986 - memset(info->data_buff, 0xFF, info->buf_count); 987 - } 988 - 989 - } 990 - 991 - static int prepare_set_command(struct pxa3xx_nand_info *info, int command, 992 - int ext_cmd_type, uint16_t column, int page_addr) 993 - { 994 - int addr_cycle, exec_cmd; 995 - struct pxa3xx_nand_host *host; 996 - struct mtd_info *mtd; 997 - 998 - host = info->host[info->cs]; 999 - mtd = nand_to_mtd(&host->chip); 1000 - addr_cycle = 0; 1001 - exec_cmd = 1; 1002 - 1003 - if (info->cs != 0) 1004 - info->ndcb0 = NDCB0_CSEL; 1005 - else 1006 - info->ndcb0 = 0; 1007 - 1008 - if (command == NAND_CMD_SEQIN) 1009 - exec_cmd = 0; 1010 - 1011 - addr_cycle = NDCB0_ADDR_CYC(host->row_addr_cycles 1012 - + host->col_addr_cycles); 1013 - 1014 - switch (command) { 1015 - case NAND_CMD_READOOB: 1016 - case NAND_CMD_READ0: 1017 - info->buf_start = column; 1018 - info->ndcb0 |= NDCB0_CMD_TYPE(0) 1019 - | addr_cycle 1020 - | NAND_CMD_READ0; 1021 - 1022 - if (command == NAND_CMD_READOOB) 1023 - info->buf_start += mtd->writesize; 1024 - 1025 - if (info->cur_chunk < info->nfullchunks) { 1026 - info->step_chunk_size = info->chunk_size; 1027 - info->step_spare_size = info->spare_size; 1028 - } else { 1029 - info->step_chunk_size = info->last_chunk_size; 1030 - info->step_spare_size = info->last_spare_size; 1031 - } 1032 - 1033 - /* 1034 - * Multiple page read needs an 'extended command type' field, 1035 - * which is either naked-read or last-read according to the 1036 - * state. 1037 - */ 1038 - if (mtd->writesize == PAGE_CHUNK_SIZE) { 1039 - info->ndcb0 |= NDCB0_DBC | (NAND_CMD_READSTART << 8); 1040 - } else if (mtd->writesize > PAGE_CHUNK_SIZE) { 1041 - info->ndcb0 |= NDCB0_DBC | (NAND_CMD_READSTART << 8) 1042 - | NDCB0_LEN_OVRD 1043 - | NDCB0_EXT_CMD_TYPE(ext_cmd_type); 1044 - info->ndcb3 = info->step_chunk_size + 1045 - info->step_spare_size; 1046 - } 1047 - 1048 - set_command_address(info, mtd->writesize, column, page_addr); 1049 - break; 1050 - 1051 - case NAND_CMD_SEQIN: 1052 - 1053 - info->buf_start = column; 1054 - set_command_address(info, mtd->writesize, 0, page_addr); 1055 - 1056 - /* 1057 - * Multiple page programming needs to execute the initial 1058 - * SEQIN command that sets the page address. 1059 - */ 1060 - if (mtd->writesize > PAGE_CHUNK_SIZE) { 1061 - info->ndcb0 |= NDCB0_CMD_TYPE(0x1) 1062 - | NDCB0_EXT_CMD_TYPE(ext_cmd_type) 1063 - | addr_cycle 1064 - | command; 1065 - exec_cmd = 1; 1066 - } 1067 - break; 1068 - 1069 - case NAND_CMD_PAGEPROG: 1070 - if (is_buf_blank(info->data_buff, 1071 - (mtd->writesize + mtd->oobsize))) { 1072 - exec_cmd = 0; 1073 - break; 1074 - } 1075 - 1076 - if (info->cur_chunk < info->nfullchunks) { 1077 - info->step_chunk_size = info->chunk_size; 1078 - info->step_spare_size = info->spare_size; 1079 - } else { 1080 - info->step_chunk_size = info->last_chunk_size; 1081 - info->step_spare_size = info->last_spare_size; 1082 - } 1083 - 1084 - /* Second command setting for large pages */ 1085 - if (mtd->writesize > PAGE_CHUNK_SIZE) { 1086 - /* 1087 - * Multiple page write uses the 'extended command' 1088 - * field. This can be used to issue a command dispatch 1089 - * or a naked-write depending on the current stage. 1090 - */ 1091 - info->ndcb0 |= NDCB0_CMD_TYPE(0x1) 1092 - | NDCB0_LEN_OVRD 1093 - | NDCB0_EXT_CMD_TYPE(ext_cmd_type); 1094 - info->ndcb3 = info->step_chunk_size + 1095 - info->step_spare_size; 1096 - 1097 - /* 1098 - * This is the command dispatch that completes a chunked 1099 - * page program operation. 1100 - */ 1101 - if (info->cur_chunk == info->ntotalchunks) { 1102 - info->ndcb0 = NDCB0_CMD_TYPE(0x1) 1103 - | NDCB0_EXT_CMD_TYPE(ext_cmd_type) 1104 - | command; 1105 - info->ndcb1 = 0; 1106 - info->ndcb2 = 0; 1107 - info->ndcb3 = 0; 1108 - } 1109 - } else { 1110 - info->ndcb0 |= NDCB0_CMD_TYPE(0x1) 1111 - | NDCB0_AUTO_RS 1112 - | NDCB0_ST_ROW_EN 1113 - | NDCB0_DBC 1114 - | (NAND_CMD_PAGEPROG << 8) 1115 - | NAND_CMD_SEQIN 1116 - | addr_cycle; 1117 - } 1118 - break; 1119 - 1120 - case NAND_CMD_PARAM: 1121 - info->buf_count = INIT_BUFFER_SIZE; 1122 - info->ndcb0 |= NDCB0_CMD_TYPE(0) 1123 - | NDCB0_ADDR_CYC(1) 1124 - | NDCB0_LEN_OVRD 1125 - | command; 1126 - info->ndcb1 = (column & 0xFF); 1127 - info->ndcb3 = INIT_BUFFER_SIZE; 1128 - info->step_chunk_size = INIT_BUFFER_SIZE; 1129 - break; 1130 - 1131 - case NAND_CMD_READID: 1132 - info->buf_count = READ_ID_BYTES; 1133 - info->ndcb0 |= NDCB0_CMD_TYPE(3) 1134 - | NDCB0_ADDR_CYC(1) 1135 - | command; 1136 - info->ndcb1 = (column & 0xFF); 1137 - 1138 - info->step_chunk_size = 8; 1139 - break; 1140 - case NAND_CMD_STATUS: 1141 - info->buf_count = 1; 1142 - info->ndcb0 |= NDCB0_CMD_TYPE(4) 1143 - | NDCB0_ADDR_CYC(1) 1144 - | command; 1145 - 1146 - info->step_chunk_size = 8; 1147 - break; 1148 - 1149 - case NAND_CMD_ERASE1: 1150 - info->ndcb0 |= NDCB0_CMD_TYPE(2) 1151 - | NDCB0_AUTO_RS 1152 - | NDCB0_ADDR_CYC(3) 1153 - | NDCB0_DBC 1154 - | (NAND_CMD_ERASE2 << 8) 1155 - | NAND_CMD_ERASE1; 1156 - info->ndcb1 = page_addr; 1157 - info->ndcb2 = 0; 1158 - 1159 - break; 1160 - case NAND_CMD_RESET: 1161 - info->ndcb0 |= NDCB0_CMD_TYPE(5) 1162 - | command; 1163 - 1164 - break; 1165 - 1166 - case NAND_CMD_ERASE2: 1167 - exec_cmd = 0; 1168 - break; 1169 - 1170 - default: 1171 - exec_cmd = 0; 1172 - dev_err(&info->pdev->dev, "non-supported command %x\n", 1173 - command); 1174 - break; 1175 - } 1176 - 1177 - return exec_cmd; 1178 - } 1179 - 1180 - static void nand_cmdfunc(struct mtd_info *mtd, unsigned command, 1181 - int column, int page_addr) 1182 - { 1183 - struct nand_chip *chip = mtd_to_nand(mtd); 1184 - struct pxa3xx_nand_host *host = nand_get_controller_data(chip); 1185 - struct pxa3xx_nand_info *info = host->info_data; 1186 - int exec_cmd; 1187 - 1188 - /* 1189 - * if this is a x16 device ,then convert the input 1190 - * "byte" address into a "word" address appropriate 1191 - * for indexing a word-oriented device 1192 - */ 1193 - if (info->reg_ndcr & NDCR_DWIDTH_M) 1194 - column /= 2; 1195 - 1196 - /* 1197 - * There may be different NAND chip hooked to 1198 - * different chip select, so check whether 1199 - * chip select has been changed, if yes, reset the timing 1200 - */ 1201 - if (info->cs != host->cs) { 1202 - info->cs = host->cs; 1203 - nand_writel(info, NDTR0CS0, info->ndtr0cs0); 1204 - nand_writel(info, NDTR1CS0, info->ndtr1cs0); 1205 - } 1206 - 1207 - prepare_start_command(info, command); 1208 - 1209 - info->state = STATE_PREPARED; 1210 - exec_cmd = prepare_set_command(info, command, 0, column, page_addr); 1211 - 1212 - if (exec_cmd) { 1213 - init_completion(&info->cmd_complete); 1214 - init_completion(&info->dev_ready); 1215 - info->need_wait = 1; 1216 - pxa3xx_nand_start(info); 1217 - 1218 - if (!wait_for_completion_timeout(&info->cmd_complete, 1219 - CHIP_DELAY_TIMEOUT)) { 1220 - dev_err(&info->pdev->dev, "Wait time out!!!\n"); 1221 - /* Stop State Machine for next command cycle */ 1222 - pxa3xx_nand_stop(info); 1223 - } 1224 - } 1225 - info->state = STATE_IDLE; 1226 - } 1227 - 1228 - static void nand_cmdfunc_extended(struct mtd_info *mtd, 1229 - const unsigned command, 1230 - int column, int page_addr) 1231 - { 1232 - struct nand_chip *chip = mtd_to_nand(mtd); 1233 - struct pxa3xx_nand_host *host = nand_get_controller_data(chip); 1234 - struct pxa3xx_nand_info *info = host->info_data; 1235 - int exec_cmd, ext_cmd_type; 1236 - 1237 - /* 1238 - * if this is a x16 device then convert the input 1239 - * "byte" address into a "word" address appropriate 1240 - * for indexing a word-oriented device 1241 - */ 1242 - if (info->reg_ndcr & NDCR_DWIDTH_M) 1243 - column /= 2; 1244 - 1245 - /* 1246 - * There may be different NAND chip hooked to 1247 - * different chip select, so check whether 1248 - * chip select has been changed, if yes, reset the timing 1249 - */ 1250 - if (info->cs != host->cs) { 1251 - info->cs = host->cs; 1252 - nand_writel(info, NDTR0CS0, info->ndtr0cs0); 1253 - nand_writel(info, NDTR1CS0, info->ndtr1cs0); 1254 - } 1255 - 1256 - /* Select the extended command for the first command */ 1257 - switch (command) { 1258 - case NAND_CMD_READ0: 1259 - case NAND_CMD_READOOB: 1260 - ext_cmd_type = EXT_CMD_TYPE_MONO; 1261 - break; 1262 - case NAND_CMD_SEQIN: 1263 - ext_cmd_type = EXT_CMD_TYPE_DISPATCH; 1264 - break; 1265 - case NAND_CMD_PAGEPROG: 1266 - ext_cmd_type = EXT_CMD_TYPE_NAKED_RW; 1267 - break; 1268 - default: 1269 - ext_cmd_type = 0; 1270 - break; 1271 - } 1272 - 1273 - prepare_start_command(info, command); 1274 - 1275 - /* 1276 - * Prepare the "is ready" completion before starting a command 1277 - * transaction sequence. If the command is not executed the 1278 - * completion will be completed, see below. 1279 - * 1280 - * We can do that inside the loop because the command variable 1281 - * is invariant and thus so is the exec_cmd. 1282 - */ 1283 - info->need_wait = 1; 1284 - init_completion(&info->dev_ready); 1285 - do { 1286 - info->state = STATE_PREPARED; 1287 - 1288 - exec_cmd = prepare_set_command(info, command, ext_cmd_type, 1289 - column, page_addr); 1290 - if (!exec_cmd) { 1291 - info->need_wait = 0; 1292 - complete(&info->dev_ready); 1293 - break; 1294 - } 1295 - 1296 - init_completion(&info->cmd_complete); 1297 - pxa3xx_nand_start(info); 1298 - 1299 - if (!wait_for_completion_timeout(&info->cmd_complete, 1300 - CHIP_DELAY_TIMEOUT)) { 1301 - dev_err(&info->pdev->dev, "Wait time out!!!\n"); 1302 - /* Stop State Machine for next command cycle */ 1303 - pxa3xx_nand_stop(info); 1304 - break; 1305 - } 1306 - 1307 - /* Only a few commands need several steps */ 1308 - if (command != NAND_CMD_PAGEPROG && 1309 - command != NAND_CMD_READ0 && 1310 - command != NAND_CMD_READOOB) 1311 - break; 1312 - 1313 - info->cur_chunk++; 1314 - 1315 - /* Check if the sequence is complete */ 1316 - if (info->cur_chunk == info->ntotalchunks && command != NAND_CMD_PAGEPROG) 1317 - break; 1318 - 1319 - /* 1320 - * After a splitted program command sequence has issued 1321 - * the command dispatch, the command sequence is complete. 1322 - */ 1323 - if (info->cur_chunk == (info->ntotalchunks + 1) && 1324 - command == NAND_CMD_PAGEPROG && 1325 - ext_cmd_type == EXT_CMD_TYPE_DISPATCH) 1326 - break; 1327 - 1328 - if (command == NAND_CMD_READ0 || command == NAND_CMD_READOOB) { 1329 - /* Last read: issue a 'last naked read' */ 1330 - if (info->cur_chunk == info->ntotalchunks - 1) 1331 - ext_cmd_type = EXT_CMD_TYPE_LAST_RW; 1332 - else 1333 - ext_cmd_type = EXT_CMD_TYPE_NAKED_RW; 1334 - 1335 - /* 1336 - * If a splitted program command has no more data to transfer, 1337 - * the command dispatch must be issued to complete. 1338 - */ 1339 - } else if (command == NAND_CMD_PAGEPROG && 1340 - info->cur_chunk == info->ntotalchunks) { 1341 - ext_cmd_type = EXT_CMD_TYPE_DISPATCH; 1342 - } 1343 - } while (1); 1344 - 1345 - info->state = STATE_IDLE; 1346 - } 1347 - 1348 - static int pxa3xx_nand_write_page_hwecc(struct mtd_info *mtd, 1349 - struct nand_chip *chip, const uint8_t *buf, int oob_required, 1350 - int page) 1351 - { 1352 - nand_prog_page_begin_op(chip, page, 0, buf, mtd->writesize); 1353 - chip->write_buf(mtd, chip->oob_poi, mtd->oobsize); 1354 - 1355 - return nand_prog_page_end_op(chip); 1356 - } 1357 - 1358 - static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd, 1359 - struct nand_chip *chip, uint8_t *buf, int oob_required, 1360 - int page) 1361 - { 1362 - struct pxa3xx_nand_host *host = nand_get_controller_data(chip); 1363 - struct pxa3xx_nand_info *info = host->info_data; 1364 - 1365 - nand_read_page_op(chip, page, 0, buf, mtd->writesize); 1366 - chip->read_buf(mtd, chip->oob_poi, mtd->oobsize); 1367 - 1368 - if (info->retcode == ERR_CORERR && info->use_ecc) { 1369 - mtd->ecc_stats.corrected += info->ecc_err_cnt; 1370 - 1371 - } else if (info->retcode == ERR_UNCORERR) { 1372 - /* 1373 - * for blank page (all 0xff), HW will calculate its ECC as 1374 - * 0, which is different from the ECC information within 1375 - * OOB, ignore such uncorrectable errors 1376 - */ 1377 - if (is_buf_blank(buf, mtd->writesize)) 1378 - info->retcode = ERR_NONE; 1379 - else 1380 - mtd->ecc_stats.failed++; 1381 - } 1382 - 1383 - return info->max_bitflips; 1384 - } 1385 - 1386 - static uint8_t pxa3xx_nand_read_byte(struct mtd_info *mtd) 1387 - { 1388 - struct nand_chip *chip = mtd_to_nand(mtd); 1389 - struct pxa3xx_nand_host *host = nand_get_controller_data(chip); 1390 - struct pxa3xx_nand_info *info = host->info_data; 1391 - char retval = 0xFF; 1392 - 1393 - if (info->buf_start < info->buf_count) 1394 - /* Has just send a new command? */ 1395 - retval = info->data_buff[info->buf_start++]; 1396 - 1397 - return retval; 1398 - } 1399 - 1400 - static u16 pxa3xx_nand_read_word(struct mtd_info *mtd) 1401 - { 1402 - struct nand_chip *chip = mtd_to_nand(mtd); 1403 - struct pxa3xx_nand_host *host = nand_get_controller_data(chip); 1404 - struct pxa3xx_nand_info *info = host->info_data; 1405 - u16 retval = 0xFFFF; 1406 - 1407 - if (!(info->buf_start & 0x01) && info->buf_start < info->buf_count) { 1408 - retval = *((u16 *)(info->data_buff+info->buf_start)); 1409 - info->buf_start += 2; 1410 - } 1411 - return retval; 1412 - } 1413 - 1414 - static void pxa3xx_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) 1415 - { 1416 - struct nand_chip *chip = mtd_to_nand(mtd); 1417 - struct pxa3xx_nand_host *host = nand_get_controller_data(chip); 1418 - struct pxa3xx_nand_info *info = host->info_data; 1419 - int real_len = min_t(size_t, len, info->buf_count - info->buf_start); 1420 - 1421 - memcpy(buf, info->data_buff + info->buf_start, real_len); 1422 - info->buf_start += real_len; 1423 - } 1424 - 1425 - static void pxa3xx_nand_write_buf(struct mtd_info *mtd, 1426 - const uint8_t *buf, int len) 1427 - { 1428 - struct nand_chip *chip = mtd_to_nand(mtd); 1429 - struct pxa3xx_nand_host *host = nand_get_controller_data(chip); 1430 - struct pxa3xx_nand_info *info = host->info_data; 1431 - int real_len = min_t(size_t, len, info->buf_count - info->buf_start); 1432 - 1433 - memcpy(info->data_buff + info->buf_start, buf, real_len); 1434 - info->buf_start += real_len; 1435 - } 1436 - 1437 - static void pxa3xx_nand_select_chip(struct mtd_info *mtd, int chip) 1438 - { 1439 - return; 1440 - } 1441 - 1442 - static int pxa3xx_nand_waitfunc(struct mtd_info *mtd, struct nand_chip *this) 1443 - { 1444 - struct nand_chip *chip = mtd_to_nand(mtd); 1445 - struct pxa3xx_nand_host *host = nand_get_controller_data(chip); 1446 - struct pxa3xx_nand_info *info = host->info_data; 1447 - 1448 - if (info->need_wait) { 1449 - info->need_wait = 0; 1450 - if (!wait_for_completion_timeout(&info->dev_ready, 1451 - CHIP_DELAY_TIMEOUT)) { 1452 - dev_err(&info->pdev->dev, "Ready time out!!!\n"); 1453 - return NAND_STATUS_FAIL; 1454 - } 1455 - } 1456 - 1457 - /* pxa3xx_nand_send_command has waited for command complete */ 1458 - if (this->state == FL_WRITING || this->state == FL_ERASING) { 1459 - if (info->retcode == ERR_NONE) 1460 - return 0; 1461 - else 1462 - return NAND_STATUS_FAIL; 1463 - } 1464 - 1465 - return NAND_STATUS_READY; 1466 - } 1467 - 1468 - static int pxa3xx_nand_config_ident(struct pxa3xx_nand_info *info) 1469 - { 1470 - struct pxa3xx_nand_host *host = info->host[info->cs]; 1471 - struct platform_device *pdev = info->pdev; 1472 - struct pxa3xx_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); 1473 - const struct nand_sdr_timings *timings; 1474 - 1475 - /* Configure default flash values */ 1476 - info->chunk_size = PAGE_CHUNK_SIZE; 1477 - info->reg_ndcr = 0x0; /* enable all interrupts */ 1478 - info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0; 1479 - info->reg_ndcr |= NDCR_RD_ID_CNT(READ_ID_BYTES); 1480 - info->reg_ndcr |= NDCR_SPARE_EN; 1481 - 1482 - /* use the common timing to make a try */ 1483 - timings = onfi_async_timing_mode_to_sdr_timings(0); 1484 - if (IS_ERR(timings)) 1485 - return PTR_ERR(timings); 1486 - 1487 - pxa3xx_nand_set_sdr_timing(host, timings); 1488 - return 0; 1489 - } 1490 - 1491 - static void pxa3xx_nand_config_tail(struct pxa3xx_nand_info *info) 1492 - { 1493 - struct pxa3xx_nand_host *host = info->host[info->cs]; 1494 - struct nand_chip *chip = &host->chip; 1495 - struct mtd_info *mtd = nand_to_mtd(chip); 1496 - 1497 - info->reg_ndcr |= (host->col_addr_cycles == 2) ? NDCR_RA_START : 0; 1498 - info->reg_ndcr |= (chip->page_shift == 6) ? NDCR_PG_PER_BLK : 0; 1499 - info->reg_ndcr |= (mtd->writesize == 2048) ? NDCR_PAGE_SZ : 0; 1500 - } 1501 - 1502 - static void pxa3xx_nand_detect_config(struct pxa3xx_nand_info *info) 1503 - { 1504 - struct platform_device *pdev = info->pdev; 1505 - struct pxa3xx_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); 1506 - uint32_t ndcr = nand_readl(info, NDCR); 1507 - 1508 - /* Set an initial chunk size */ 1509 - info->chunk_size = ndcr & NDCR_PAGE_SZ ? 2048 : 512; 1510 - info->reg_ndcr = ndcr & 1511 - ~(NDCR_INT_MASK | NDCR_ND_ARB_EN | NFCV1_NDCR_ARB_CNTL); 1512 - info->reg_ndcr |= (pdata->enable_arbiter) ? NDCR_ND_ARB_EN : 0; 1513 - info->ndtr0cs0 = nand_readl(info, NDTR0CS0); 1514 - info->ndtr1cs0 = nand_readl(info, NDTR1CS0); 1515 - } 1516 - 1517 - static int pxa3xx_nand_init_buff(struct pxa3xx_nand_info *info) 1518 - { 1519 - struct platform_device *pdev = info->pdev; 1520 - struct dma_slave_config config; 1521 - dma_cap_mask_t mask; 1522 - struct pxad_param param; 1523 - int ret; 1524 - 1525 - info->data_buff = kmalloc(info->buf_size, GFP_KERNEL); 1526 - if (info->data_buff == NULL) 1527 - return -ENOMEM; 1528 - if (use_dma == 0) 1529 - return 0; 1530 - 1531 - ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32)); 1532 - if (ret) 1533 - return ret; 1534 - 1535 - sg_init_one(&info->sg, info->data_buff, info->buf_size); 1536 - dma_cap_zero(mask); 1537 - dma_cap_set(DMA_SLAVE, mask); 1538 - param.prio = PXAD_PRIO_LOWEST; 1539 - param.drcmr = info->drcmr_dat; 1540 - info->dma_chan = dma_request_slave_channel_compat(mask, pxad_filter_fn, 1541 - &param, &pdev->dev, 1542 - "data"); 1543 - if (!info->dma_chan) { 1544 - dev_err(&pdev->dev, "unable to request data dma channel\n"); 1545 - return -ENODEV; 1546 - } 1547 - 1548 - memset(&config, 0, sizeof(config)); 1549 - config.src_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 1550 - config.dst_addr_width = DMA_SLAVE_BUSWIDTH_4_BYTES; 1551 - config.src_addr = info->mmio_phys + NDDB; 1552 - config.dst_addr = info->mmio_phys + NDDB; 1553 - config.src_maxburst = 32; 1554 - config.dst_maxburst = 32; 1555 - ret = dmaengine_slave_config(info->dma_chan, &config); 1556 - if (ret < 0) { 1557 - dev_err(&info->pdev->dev, 1558 - "dma channel configuration failed: %d\n", 1559 - ret); 1560 - return ret; 1561 - } 1562 - 1563 - /* 1564 - * Now that DMA buffers are allocated we turn on 1565 - * DMA proper for I/O operations. 1566 - */ 1567 - info->use_dma = 1; 1568 - return 0; 1569 - } 1570 - 1571 - static void pxa3xx_nand_free_buff(struct pxa3xx_nand_info *info) 1572 - { 1573 - if (info->use_dma) { 1574 - dmaengine_terminate_all(info->dma_chan); 1575 - dma_release_channel(info->dma_chan); 1576 - } 1577 - kfree(info->data_buff); 1578 - } 1579 - 1580 - static int pxa_ecc_init(struct pxa3xx_nand_info *info, 1581 - struct mtd_info *mtd, 1582 - int strength, int ecc_stepsize, int page_size) 1583 - { 1584 - struct nand_chip *chip = mtd_to_nand(mtd); 1585 - struct nand_ecc_ctrl *ecc = &chip->ecc; 1586 - 1587 - if (strength == 1 && ecc_stepsize == 512 && page_size == 2048) { 1588 - info->nfullchunks = 1; 1589 - info->ntotalchunks = 1; 1590 - info->chunk_size = 2048; 1591 - info->spare_size = 40; 1592 - info->ecc_size = 24; 1593 - ecc->mode = NAND_ECC_HW; 1594 - ecc->size = 512; 1595 - ecc->strength = 1; 1596 - 1597 - } else if (strength == 1 && ecc_stepsize == 512 && page_size == 512) { 1598 - info->nfullchunks = 1; 1599 - info->ntotalchunks = 1; 1600 - info->chunk_size = 512; 1601 - info->spare_size = 8; 1602 - info->ecc_size = 8; 1603 - ecc->mode = NAND_ECC_HW; 1604 - ecc->size = 512; 1605 - ecc->strength = 1; 1606 - 1607 - /* 1608 - * Required ECC: 4-bit correction per 512 bytes 1609 - * Select: 16-bit correction per 2048 bytes 1610 - */ 1611 - } else if (strength == 4 && ecc_stepsize == 512 && page_size == 2048) { 1612 - info->ecc_bch = 1; 1613 - info->nfullchunks = 1; 1614 - info->ntotalchunks = 1; 1615 - info->chunk_size = 2048; 1616 - info->spare_size = 32; 1617 - info->ecc_size = 32; 1618 - ecc->mode = NAND_ECC_HW; 1619 - ecc->size = info->chunk_size; 1620 - mtd_set_ooblayout(mtd, &pxa3xx_ooblayout_ops); 1621 - ecc->strength = 16; 1622 - 1623 - } else if (strength == 4 && ecc_stepsize == 512 && page_size == 4096) { 1624 - info->ecc_bch = 1; 1625 - info->nfullchunks = 2; 1626 - info->ntotalchunks = 2; 1627 - info->chunk_size = 2048; 1628 - info->spare_size = 32; 1629 - info->ecc_size = 32; 1630 - ecc->mode = NAND_ECC_HW; 1631 - ecc->size = info->chunk_size; 1632 - mtd_set_ooblayout(mtd, &pxa3xx_ooblayout_ops); 1633 - ecc->strength = 16; 1634 - 1635 - /* 1636 - * Required ECC: 8-bit correction per 512 bytes 1637 - * Select: 16-bit correction per 1024 bytes 1638 - */ 1639 - } else if (strength == 8 && ecc_stepsize == 512 && page_size == 4096) { 1640 - info->ecc_bch = 1; 1641 - info->nfullchunks = 4; 1642 - info->ntotalchunks = 5; 1643 - info->chunk_size = 1024; 1644 - info->spare_size = 0; 1645 - info->last_chunk_size = 0; 1646 - info->last_spare_size = 64; 1647 - info->ecc_size = 32; 1648 - ecc->mode = NAND_ECC_HW; 1649 - ecc->size = info->chunk_size; 1650 - mtd_set_ooblayout(mtd, &pxa3xx_ooblayout_ops); 1651 - ecc->strength = 16; 1652 - } else { 1653 - dev_err(&info->pdev->dev, 1654 - "ECC strength %d at page size %d is not supported\n", 1655 - strength, page_size); 1656 - return -ENODEV; 1657 - } 1658 - 1659 - dev_info(&info->pdev->dev, "ECC strength %d, ECC step size %d\n", 1660 - ecc->strength, ecc->size); 1661 - return 0; 1662 - } 1663 - 1664 - static int pxa3xx_nand_scan(struct mtd_info *mtd) 1665 - { 1666 - struct nand_chip *chip = mtd_to_nand(mtd); 1667 - struct pxa3xx_nand_host *host = nand_get_controller_data(chip); 1668 - struct pxa3xx_nand_info *info = host->info_data; 1669 - struct platform_device *pdev = info->pdev; 1670 - struct pxa3xx_nand_platform_data *pdata = dev_get_platdata(&pdev->dev); 1671 - int ret; 1672 - uint16_t ecc_strength, ecc_step; 1673 - 1674 - if (pdata->keep_config) { 1675 - pxa3xx_nand_detect_config(info); 1676 - } else { 1677 - ret = pxa3xx_nand_config_ident(info); 1678 - if (ret) 1679 - return ret; 1680 - } 1681 - 1682 - if (info->reg_ndcr & NDCR_DWIDTH_M) 1683 - chip->options |= NAND_BUSWIDTH_16; 1684 - 1685 - /* Device detection must be done with ECC disabled */ 1686 - if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370 || 1687 - info->variant == PXA3XX_NAND_VARIANT_ARMADA_8K) 1688 - nand_writel(info, NDECCCTRL, 0x0); 1689 - 1690 - if (pdata->flash_bbt) 1691 - chip->bbt_options |= NAND_BBT_USE_FLASH; 1692 - 1693 - chip->ecc.strength = pdata->ecc_strength; 1694 - chip->ecc.size = pdata->ecc_step_size; 1695 - 1696 - ret = nand_scan_ident(mtd, 1, NULL); 1697 - if (ret) 1698 - return ret; 1699 - 1700 - if (!pdata->keep_config) { 1701 - ret = pxa3xx_nand_init(host); 1702 - if (ret) { 1703 - dev_err(&info->pdev->dev, "Failed to init nand: %d\n", 1704 - ret); 1705 - return ret; 1706 - } 1707 - } 1708 - 1709 - if (chip->bbt_options & NAND_BBT_USE_FLASH) { 1710 - /* 1711 - * We'll use a bad block table stored in-flash and don't 1712 - * allow writing the bad block marker to the flash. 1713 - */ 1714 - chip->bbt_options |= NAND_BBT_NO_OOB_BBM; 1715 - chip->bbt_td = &bbt_main_descr; 1716 - chip->bbt_md = &bbt_mirror_descr; 1717 - } 1718 - 1719 - /* 1720 - * If the page size is bigger than the FIFO size, let's check 1721 - * we are given the right variant and then switch to the extended 1722 - * (aka splitted) command handling, 1723 - */ 1724 - if (mtd->writesize > PAGE_CHUNK_SIZE) { 1725 - if (info->variant == PXA3XX_NAND_VARIANT_ARMADA370 || 1726 - info->variant == PXA3XX_NAND_VARIANT_ARMADA_8K) { 1727 - chip->cmdfunc = nand_cmdfunc_extended; 1728 - } else { 1729 - dev_err(&info->pdev->dev, 1730 - "unsupported page size on this variant\n"); 1731 - return -ENODEV; 1732 - } 1733 - } 1734 - 1735 - ecc_strength = chip->ecc.strength; 1736 - ecc_step = chip->ecc.size; 1737 - if (!ecc_strength || !ecc_step) { 1738 - ecc_strength = chip->ecc_strength_ds; 1739 - ecc_step = chip->ecc_step_ds; 1740 - } 1741 - 1742 - /* Set default ECC strength requirements on non-ONFI devices */ 1743 - if (ecc_strength < 1 && ecc_step < 1) { 1744 - ecc_strength = 1; 1745 - ecc_step = 512; 1746 - } 1747 - 1748 - ret = pxa_ecc_init(info, mtd, ecc_strength, 1749 - ecc_step, mtd->writesize); 1750 - if (ret) 1751 - return ret; 1752 - 1753 - /* calculate addressing information */ 1754 - if (mtd->writesize >= 2048) 1755 - host->col_addr_cycles = 2; 1756 - else 1757 - host->col_addr_cycles = 1; 1758 - 1759 - /* release the initial buffer */ 1760 - kfree(info->data_buff); 1761 - 1762 - /* allocate the real data + oob buffer */ 1763 - info->buf_size = mtd->writesize + mtd->oobsize; 1764 - ret = pxa3xx_nand_init_buff(info); 1765 - if (ret) 1766 - return ret; 1767 - info->oob_buff = info->data_buff + mtd->writesize; 1768 - 1769 - if ((mtd->size >> chip->page_shift) > 65536) 1770 - host->row_addr_cycles = 3; 1771 - else 1772 - host->row_addr_cycles = 2; 1773 - 1774 - if (!pdata->keep_config) 1775 - pxa3xx_nand_config_tail(info); 1776 - 1777 - return nand_scan_tail(mtd); 1778 - } 1779 - 1780 - static int alloc_nand_resource(struct platform_device *pdev) 1781 - { 1782 - struct device_node *np = pdev->dev.of_node; 1783 - struct pxa3xx_nand_platform_data *pdata; 1784 - struct pxa3xx_nand_info *info; 1785 - struct pxa3xx_nand_host *host; 1786 - struct nand_chip *chip = NULL; 1787 - struct mtd_info *mtd; 1788 - struct resource *r; 1789 - int ret, irq, cs; 1790 - 1791 - pdata = dev_get_platdata(&pdev->dev); 1792 - if (pdata->num_cs <= 0) { 1793 - dev_err(&pdev->dev, "invalid number of chip selects\n"); 1794 - return -ENODEV; 1795 - } 1796 - 1797 - info = devm_kzalloc(&pdev->dev, 1798 - sizeof(*info) + sizeof(*host) * pdata->num_cs, 1799 - GFP_KERNEL); 1800 - if (!info) 1801 - return -ENOMEM; 1802 - 1803 - info->pdev = pdev; 1804 - info->variant = pxa3xx_nand_get_variant(pdev); 1805 - for (cs = 0; cs < pdata->num_cs; cs++) { 1806 - host = (void *)&info[1] + sizeof(*host) * cs; 1807 - chip = &host->chip; 1808 - nand_set_controller_data(chip, host); 1809 - mtd = nand_to_mtd(chip); 1810 - info->host[cs] = host; 1811 - host->cs = cs; 1812 - host->info_data = info; 1813 - mtd->dev.parent = &pdev->dev; 1814 - /* FIXME: all chips use the same device tree partitions */ 1815 - nand_set_flash_node(chip, np); 1816 - 1817 - nand_set_controller_data(chip, host); 1818 - chip->ecc.read_page = pxa3xx_nand_read_page_hwecc; 1819 - chip->ecc.write_page = pxa3xx_nand_write_page_hwecc; 1820 - chip->controller = &info->controller; 1821 - chip->waitfunc = pxa3xx_nand_waitfunc; 1822 - chip->select_chip = pxa3xx_nand_select_chip; 1823 - chip->read_word = pxa3xx_nand_read_word; 1824 - chip->read_byte = pxa3xx_nand_read_byte; 1825 - chip->read_buf = pxa3xx_nand_read_buf; 1826 - chip->write_buf = pxa3xx_nand_write_buf; 1827 - chip->options |= NAND_NO_SUBPAGE_WRITE; 1828 - chip->cmdfunc = nand_cmdfunc; 1829 - chip->onfi_set_features = nand_onfi_get_set_features_notsupp; 1830 - chip->onfi_get_features = nand_onfi_get_set_features_notsupp; 1831 - } 1832 - 1833 - nand_hw_control_init(chip->controller); 1834 - info->clk = devm_clk_get(&pdev->dev, NULL); 1835 - if (IS_ERR(info->clk)) { 1836 - ret = PTR_ERR(info->clk); 1837 - dev_err(&pdev->dev, "failed to get nand clock: %d\n", ret); 1838 - return ret; 1839 - } 1840 - ret = clk_prepare_enable(info->clk); 1841 - if (ret < 0) 1842 - return ret; 1843 - 1844 - if (!np && use_dma) { 1845 - r = platform_get_resource(pdev, IORESOURCE_DMA, 0); 1846 - if (r == NULL) { 1847 - dev_err(&pdev->dev, 1848 - "no resource defined for data DMA\n"); 1849 - ret = -ENXIO; 1850 - goto fail_disable_clk; 1851 - } 1852 - info->drcmr_dat = r->start; 1853 - } 1854 - 1855 - irq = platform_get_irq(pdev, 0); 1856 - if (irq < 0) { 1857 - dev_err(&pdev->dev, "no IRQ resource defined\n"); 1858 - ret = -ENXIO; 1859 - goto fail_disable_clk; 1860 - } 1861 - 1862 - r = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1863 - info->mmio_base = devm_ioremap_resource(&pdev->dev, r); 1864 - if (IS_ERR(info->mmio_base)) { 1865 - ret = PTR_ERR(info->mmio_base); 1866 - dev_err(&pdev->dev, "failed to map register space: %d\n", ret); 1867 - goto fail_disable_clk; 1868 - } 1869 - info->mmio_phys = r->start; 1870 - 1871 - /* Allocate a buffer to allow flash detection */ 1872 - info->buf_size = INIT_BUFFER_SIZE; 1873 - info->data_buff = kmalloc(info->buf_size, GFP_KERNEL); 1874 - if (info->data_buff == NULL) { 1875 - ret = -ENOMEM; 1876 - goto fail_disable_clk; 1877 - } 1878 - 1879 - /* initialize all interrupts to be disabled */ 1880 - disable_int(info, NDSR_MASK); 1881 - 1882 - ret = request_threaded_irq(irq, pxa3xx_nand_irq, 1883 - pxa3xx_nand_irq_thread, IRQF_ONESHOT, 1884 - pdev->name, info); 1885 - if (ret < 0) { 1886 - dev_err(&pdev->dev, "failed to request IRQ: %d\n", ret); 1887 - goto fail_free_buf; 1888 - } 1889 - 1890 - platform_set_drvdata(pdev, info); 1891 - 1892 - return 0; 1893 - 1894 - fail_free_buf: 1895 - free_irq(irq, info); 1896 - kfree(info->data_buff); 1897 - fail_disable_clk: 1898 - clk_disable_unprepare(info->clk); 1899 - return ret; 1900 - } 1901 - 1902 - static int pxa3xx_nand_remove(struct platform_device *pdev) 1903 - { 1904 - struct pxa3xx_nand_info *info = platform_get_drvdata(pdev); 1905 - struct pxa3xx_nand_platform_data *pdata; 1906 - int irq, cs; 1907 - 1908 - if (!info) 1909 - return 0; 1910 - 1911 - pdata = dev_get_platdata(&pdev->dev); 1912 - 1913 - irq = platform_get_irq(pdev, 0); 1914 - if (irq >= 0) 1915 - free_irq(irq, info); 1916 - pxa3xx_nand_free_buff(info); 1917 - 1918 - /* 1919 - * In the pxa3xx case, the DFI bus is shared between the SMC and NFC. 1920 - * In order to prevent a lockup of the system bus, the DFI bus 1921 - * arbitration is granted to SMC upon driver removal. This is done by 1922 - * setting the x_ARB_CNTL bit, which also prevents the NAND to have 1923 - * access to the bus anymore. 1924 - */ 1925 - nand_writel(info, NDCR, 1926 - (nand_readl(info, NDCR) & ~NDCR_ND_ARB_EN) | 1927 - NFCV1_NDCR_ARB_CNTL); 1928 - clk_disable_unprepare(info->clk); 1929 - 1930 - for (cs = 0; cs < pdata->num_cs; cs++) 1931 - nand_release(nand_to_mtd(&info->host[cs]->chip)); 1932 - return 0; 1933 - } 1934 - 1935 - static int pxa3xx_nand_probe_dt(struct platform_device *pdev) 1936 - { 1937 - struct pxa3xx_nand_platform_data *pdata; 1938 - struct device_node *np = pdev->dev.of_node; 1939 - const struct of_device_id *of_id = 1940 - of_match_device(pxa3xx_nand_dt_ids, &pdev->dev); 1941 - 1942 - if (!of_id) 1943 - return 0; 1944 - 1945 - /* 1946 - * Some SoCs like A7k/A8k need to enable manually the NAND 1947 - * controller to avoid being bootloader dependent. This is done 1948 - * through the use of a single bit in the System Functions registers. 1949 - */ 1950 - if (pxa3xx_nand_get_variant(pdev) == PXA3XX_NAND_VARIANT_ARMADA_8K) { 1951 - struct regmap *sysctrl_base = syscon_regmap_lookup_by_phandle( 1952 - pdev->dev.of_node, "marvell,system-controller"); 1953 - u32 reg; 1954 - 1955 - if (IS_ERR(sysctrl_base)) 1956 - return PTR_ERR(sysctrl_base); 1957 - 1958 - regmap_read(sysctrl_base, GENCONF_SOC_DEVICE_MUX, &reg); 1959 - reg |= GENCONF_SOC_DEVICE_MUX_NFC_EN; 1960 - regmap_write(sysctrl_base, GENCONF_SOC_DEVICE_MUX, reg); 1961 - } 1962 - 1963 - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); 1964 - if (!pdata) 1965 - return -ENOMEM; 1966 - 1967 - if (of_get_property(np, "marvell,nand-enable-arbiter", NULL)) 1968 - pdata->enable_arbiter = 1; 1969 - if (of_get_property(np, "marvell,nand-keep-config", NULL)) 1970 - pdata->keep_config = 1; 1971 - of_property_read_u32(np, "num-cs", &pdata->num_cs); 1972 - 1973 - pdev->dev.platform_data = pdata; 1974 - 1975 - return 0; 1976 - } 1977 - 1978 - static int pxa3xx_nand_probe(struct platform_device *pdev) 1979 - { 1980 - struct pxa3xx_nand_platform_data *pdata; 1981 - struct pxa3xx_nand_info *info; 1982 - int ret, cs, probe_success, dma_available; 1983 - 1984 - dma_available = IS_ENABLED(CONFIG_ARM) && 1985 - (IS_ENABLED(CONFIG_ARCH_PXA) || IS_ENABLED(CONFIG_ARCH_MMP)); 1986 - if (use_dma && !dma_available) { 1987 - use_dma = 0; 1988 - dev_warn(&pdev->dev, 1989 - "This platform can't do DMA on this device\n"); 1990 - } 1991 - 1992 - ret = pxa3xx_nand_probe_dt(pdev); 1993 - if (ret) 1994 - return ret; 1995 - 1996 - pdata = dev_get_platdata(&pdev->dev); 1997 - if (!pdata) { 1998 - dev_err(&pdev->dev, "no platform data defined\n"); 1999 - return -ENODEV; 2000 - } 2001 - 2002 - ret = alloc_nand_resource(pdev); 2003 - if (ret) 2004 - return ret; 2005 - 2006 - info = platform_get_drvdata(pdev); 2007 - probe_success = 0; 2008 - for (cs = 0; cs < pdata->num_cs; cs++) { 2009 - struct mtd_info *mtd = nand_to_mtd(&info->host[cs]->chip); 2010 - 2011 - /* 2012 - * The mtd name matches the one used in 'mtdparts' kernel 2013 - * parameter. This name cannot be changed or otherwise 2014 - * user's mtd partitions configuration would get broken. 2015 - */ 2016 - mtd->name = "pxa3xx_nand-0"; 2017 - info->cs = cs; 2018 - ret = pxa3xx_nand_scan(mtd); 2019 - if (ret) { 2020 - dev_warn(&pdev->dev, "failed to scan nand at cs %d\n", 2021 - cs); 2022 - continue; 2023 - } 2024 - 2025 - ret = mtd_device_register(mtd, pdata->parts[cs], 2026 - pdata->nr_parts[cs]); 2027 - if (!ret) 2028 - probe_success = 1; 2029 - } 2030 - 2031 - if (!probe_success) { 2032 - pxa3xx_nand_remove(pdev); 2033 - return -ENODEV; 2034 - } 2035 - 2036 - return 0; 2037 - } 2038 - 2039 - #ifdef CONFIG_PM 2040 - static int pxa3xx_nand_suspend(struct device *dev) 2041 - { 2042 - struct pxa3xx_nand_info *info = dev_get_drvdata(dev); 2043 - 2044 - if (info->state) { 2045 - dev_err(dev, "driver busy, state = %d\n", info->state); 2046 - return -EAGAIN; 2047 - } 2048 - 2049 - clk_disable(info->clk); 2050 - return 0; 2051 - } 2052 - 2053 - static int pxa3xx_nand_resume(struct device *dev) 2054 - { 2055 - struct pxa3xx_nand_info *info = dev_get_drvdata(dev); 2056 - int ret; 2057 - 2058 - ret = clk_enable(info->clk); 2059 - if (ret < 0) 2060 - return ret; 2061 - 2062 - /* We don't want to handle interrupt without calling mtd routine */ 2063 - disable_int(info, NDCR_INT_MASK); 2064 - 2065 - /* 2066 - * Directly set the chip select to a invalid value, 2067 - * then the driver would reset the timing according 2068 - * to current chip select at the beginning of cmdfunc 2069 - */ 2070 - info->cs = 0xff; 2071 - 2072 - /* 2073 - * As the spec says, the NDSR would be updated to 0x1800 when 2074 - * doing the nand_clk disable/enable. 2075 - * To prevent it damaging state machine of the driver, clear 2076 - * all status before resume 2077 - */ 2078 - nand_writel(info, NDSR, NDSR_MASK); 2079 - 2080 - return 0; 2081 - } 2082 - #else 2083 - #define pxa3xx_nand_suspend NULL 2084 - #define pxa3xx_nand_resume NULL 2085 - #endif 2086 - 2087 - static const struct dev_pm_ops pxa3xx_nand_pm_ops = { 2088 - .suspend = pxa3xx_nand_suspend, 2089 - .resume = pxa3xx_nand_resume, 2090 - }; 2091 - 2092 - static struct platform_driver pxa3xx_nand_driver = { 2093 - .driver = { 2094 - .name = "pxa3xx-nand", 2095 - .of_match_table = pxa3xx_nand_dt_ids, 2096 - .pm = &pxa3xx_nand_pm_ops, 2097 - }, 2098 - .probe = pxa3xx_nand_probe, 2099 - .remove = pxa3xx_nand_remove, 2100 - }; 2101 - 2102 - module_platform_driver(pxa3xx_nand_driver); 2103 - 2104 - MODULE_LICENSE("GPL"); 2105 - MODULE_DESCRIPTION("PXA3xx NAND controller driver");
+9 -7
drivers/phy/ti/phy-da8xx-usb.c
··· 20 20 #include <linux/mfd/syscon.h> 21 21 #include <linux/module.h> 22 22 #include <linux/phy/phy.h> 23 + #include <linux/platform_data/phy-da8xx-usb.h> 23 24 #include <linux/platform_device.h> 24 25 #include <linux/regmap.h> 25 26 ··· 146 145 static int da8xx_usb_phy_probe(struct platform_device *pdev) 147 146 { 148 147 struct device *dev = &pdev->dev; 148 + struct da8xx_usb_phy_platform_data *pdata = dev->platform_data; 149 149 struct device_node *node = dev->of_node; 150 150 struct da8xx_usb_phy *d_phy; 151 151 ··· 154 152 if (!d_phy) 155 153 return -ENOMEM; 156 154 157 - if (node) 155 + if (pdata) 156 + d_phy->regmap = pdata->cfgchip; 157 + else 158 158 d_phy->regmap = syscon_regmap_lookup_by_compatible( 159 159 "ti,da830-cfgchip"); 160 - else 161 - d_phy->regmap = syscon_regmap_lookup_by_pdevname("syscon"); 162 160 if (IS_ERR(d_phy->regmap)) { 163 161 dev_err(dev, "Failed to get syscon\n"); 164 162 return PTR_ERR(d_phy->regmap); 165 163 } 166 164 167 - d_phy->usb11_clk = devm_clk_get(dev, "usb11_phy"); 165 + d_phy->usb11_clk = devm_clk_get(dev, "usb1_clk48"); 168 166 if (IS_ERR(d_phy->usb11_clk)) { 169 - dev_err(dev, "Failed to get usb11_phy clock\n"); 167 + dev_err(dev, "Failed to get usb1_clk48\n"); 170 168 return PTR_ERR(d_phy->usb11_clk); 171 169 } 172 170 173 - d_phy->usb20_clk = devm_clk_get(dev, "usb20_phy"); 171 + d_phy->usb20_clk = devm_clk_get(dev, "usb0_clk48"); 174 172 if (IS_ERR(d_phy->usb20_clk)) { 175 - dev_err(dev, "Failed to get usb20_phy clock\n"); 173 + dev_err(dev, "Failed to get usb0_clk48\n"); 176 174 return PTR_ERR(d_phy->usb20_clk); 177 175 } 178 176
+34 -7
drivers/power/avs/smartreflex.c
··· 132 132 struct clk *fck; 133 133 u32 fclk_speed; 134 134 135 - fck = clk_get(&sr->pdev->dev, "fck"); 136 - 135 + /* Try interconnect target module fck first if it already exists */ 136 + fck = clk_get(sr->pdev->dev.parent, "fck"); 137 137 if (IS_ERR(fck)) { 138 - dev_err(&sr->pdev->dev, "%s: unable to get fck for device %s\n", 139 - __func__, dev_name(&sr->pdev->dev)); 140 - return; 138 + fck = clk_get(&sr->pdev->dev, "fck"); 139 + if (IS_ERR(fck)) { 140 + dev_err(&sr->pdev->dev, 141 + "%s: unable to get fck for device %s\n", 142 + __func__, dev_name(&sr->pdev->dev)); 143 + return; 144 + } 141 145 } 142 146 143 147 fclk_speed = clk_get_rate(fck); ··· 842 838 DEFINE_SIMPLE_ATTRIBUTE(pm_sr_fops, omap_sr_autocomp_show, 843 839 omap_sr_autocomp_store, "%llu\n"); 844 840 845 - static int __init omap_sr_probe(struct platform_device *pdev) 841 + static int omap_sr_probe(struct platform_device *pdev) 846 842 { 847 843 struct omap_sr *sr_info; 848 844 struct omap_sr_data *pdata = pdev->dev.platform_data; ··· 901 897 sr_set_clk_length(sr_info); 902 898 903 899 list_add(&sr_info->node, &sr_list); 900 + 901 + ret = pm_runtime_get_sync(&pdev->dev); 902 + if (ret < 0) { 903 + pm_runtime_put_noidle(&pdev->dev); 904 + goto err_list_del; 905 + } 904 906 905 907 /* 906 908 * Call into late init to do initializations that require ··· 976 966 977 967 } 978 968 969 + pm_runtime_put_sync(&pdev->dev); 970 + 979 971 return ret; 980 972 981 973 err_debugfs: 982 974 debugfs_remove_recursive(sr_info->dbg_dir); 983 975 err_list_del: 984 976 list_del(&sr_info->node); 977 + 978 + pm_runtime_put_sync(&pdev->dev); 979 + 985 980 return ret; 986 981 } 987 982 ··· 1040 1025 return; 1041 1026 } 1042 1027 1028 + static const struct of_device_id omap_sr_match[] = { 1029 + { .compatible = "ti,omap3-smartreflex-core", }, 1030 + { .compatible = "ti,omap3-smartreflex-mpu-iva", }, 1031 + { .compatible = "ti,omap4-smartreflex-core", }, 1032 + { .compatible = "ti,omap4-smartreflex-mpu", }, 1033 + { .compatible = "ti,omap4-smartreflex-iva", }, 1034 + { }, 1035 + }; 1036 + MODULE_DEVICE_TABLE(of, omap_sr_match); 1037 + 1043 1038 static struct platform_driver smartreflex_driver = { 1039 + .probe = omap_sr_probe, 1044 1040 .remove = omap_sr_remove, 1045 1041 .shutdown = omap_sr_shutdown, 1046 1042 .driver = { 1047 1043 .name = DRIVER_NAME, 1044 + .of_match_table = omap_sr_match, 1048 1045 }, 1049 1046 }; 1050 1047 ··· 1075 1048 else 1076 1049 pr_warn("%s: No PMIC hook to init smartreflex\n", __func__); 1077 1050 1078 - ret = platform_driver_probe(&smartreflex_driver, omap_sr_probe); 1051 + ret = platform_driver_register(&smartreflex_driver); 1079 1052 if (ret) { 1080 1053 pr_err("%s: platform driver register failed for SR\n", 1081 1054 __func__);
+42 -26
drivers/pwm/pwm-omap-dmtimer.c
··· 23 23 #include <linux/mutex.h> 24 24 #include <linux/of.h> 25 25 #include <linux/of_platform.h> 26 + #include <linux/platform_data/dmtimer-omap.h> 26 27 #include <linux/platform_data/pwm_omap_dmtimer.h> 27 28 #include <linux/platform_device.h> 28 29 #include <linux/pm_runtime.h> ··· 38 37 struct pwm_chip chip; 39 38 struct mutex mutex; 40 39 pwm_omap_dmtimer *dm_timer; 41 - struct pwm_omap_dmtimer_pdata *pdata; 40 + const struct omap_dm_timer_ops *pdata; 42 41 struct platform_device *dm_timer_pdev; 43 42 }; 44 43 ··· 243 242 { 244 243 struct device_node *np = pdev->dev.of_node; 245 244 struct device_node *timer; 245 + struct platform_device *timer_pdev; 246 246 struct pwm_omap_dmtimer_chip *omap; 247 - struct pwm_omap_dmtimer_pdata *pdata; 247 + struct dmtimer_platform_data *timer_pdata; 248 + const struct omap_dm_timer_ops *pdata; 248 249 pwm_omap_dmtimer *dm_timer; 249 250 u32 v; 250 - int status; 251 + int ret = 0; 251 252 252 - pdata = dev_get_platdata(&pdev->dev); 253 - if (!pdata) { 254 - dev_err(&pdev->dev, "Missing dmtimer platform data\n"); 255 - return -EINVAL; 253 + timer = of_parse_phandle(np, "ti,timers", 0); 254 + if (!timer) 255 + return -ENODEV; 256 + 257 + timer_pdev = of_find_device_by_node(timer); 258 + if (!timer_pdev) { 259 + dev_err(&pdev->dev, "Unable to find Timer pdev\n"); 260 + ret = -ENODEV; 261 + goto put; 256 262 } 257 263 258 - if (!pdata->request_by_node || 264 + timer_pdata = dev_get_platdata(&timer_pdev->dev); 265 + if (!timer_pdata) { 266 + dev_err(&pdev->dev, "dmtimer pdata structure NULL\n"); 267 + ret = -EINVAL; 268 + goto put; 269 + } 270 + 271 + pdata = timer_pdata->timer_ops; 272 + 273 + if (!pdata || !pdata->request_by_node || 259 274 !pdata->free || 260 275 !pdata->enable || 261 276 !pdata->disable || ··· 284 267 !pdata->set_prescaler || 285 268 !pdata->write_counter) { 286 269 dev_err(&pdev->dev, "Incomplete dmtimer pdata structure\n"); 287 - return -EINVAL; 270 + ret = -EINVAL; 271 + goto put; 288 272 } 289 - 290 - timer = of_parse_phandle(np, "ti,timers", 0); 291 - if (!timer) 292 - return -ENODEV; 293 273 294 274 if (!of_get_property(timer, "ti,timer-pwm", NULL)) { 295 275 dev_err(&pdev->dev, "Missing ti,timer-pwm capability\n"); 296 - return -ENODEV; 276 + ret = -ENODEV; 277 + goto put; 297 278 } 298 279 299 280 dm_timer = pdata->request_by_node(timer); 300 - if (!dm_timer) 301 - return -EPROBE_DEFER; 281 + if (!dm_timer) { 282 + ret = -EPROBE_DEFER; 283 + goto put; 284 + } 285 + 286 + put: 287 + of_node_put(timer); 288 + if (ret < 0) 289 + return ret; 302 290 303 291 omap = devm_kzalloc(&pdev->dev, sizeof(*omap), GFP_KERNEL); 304 292 if (!omap) { ··· 313 291 314 292 omap->pdata = pdata; 315 293 omap->dm_timer = dm_timer; 316 - 317 - omap->dm_timer_pdev = of_find_device_by_node(timer); 318 - if (!omap->dm_timer_pdev) { 319 - dev_err(&pdev->dev, "Unable to find timer pdev\n"); 320 - omap->pdata->free(dm_timer); 321 - return -EINVAL; 322 - } 294 + omap->dm_timer_pdev = timer_pdev; 323 295 324 296 /* 325 297 * Ensure that the timer is stopped before we allow PWM core to call ··· 338 322 339 323 mutex_init(&omap->mutex); 340 324 341 - status = pwmchip_add(&omap->chip); 342 - if (status < 0) { 325 + ret = pwmchip_add(&omap->chip); 326 + if (ret < 0) { 343 327 dev_err(&pdev->dev, "failed to register PWM\n"); 344 328 omap->pdata->free(omap->dm_timer); 345 - return status; 329 + return ret; 346 330 } 347 331 348 332 platform_set_drvdata(pdev, omap);
+12 -2
drivers/soc/renesas/Kconfig
··· 3 3 default y if ARCH_RENESAS 4 4 select SOC_BUS 5 5 select RST_RCAR if ARCH_RCAR_GEN1 || ARCH_RCAR_GEN2 || \ 6 - ARCH_R8A7795 || ARCH_R8A7796 || ARCH_R8A77970 || \ 7 - ARCH_R8A77995 6 + ARCH_R8A7795 || ARCH_R8A7796 || ARCH_R8A77965 || \ 7 + ARCH_R8A77970 || ARCH_R8A77980 || ARCH_R8A77995 8 8 select SYSC_R8A7743 if ARCH_R8A7743 9 9 select SYSC_R8A7745 if ARCH_R8A7745 10 10 select SYSC_R8A7779 if ARCH_R8A7779 ··· 14 14 select SYSC_R8A7794 if ARCH_R8A7794 15 15 select SYSC_R8A7795 if ARCH_R8A7795 16 16 select SYSC_R8A7796 if ARCH_R8A7796 17 + select SYSC_R8A77965 if ARCH_R8A77965 17 18 select SYSC_R8A77970 if ARCH_R8A77970 19 + select SYSC_R8A77980 if ARCH_R8A77980 18 20 select SYSC_R8A77995 if ARCH_R8A77995 19 21 20 22 if SOC_RENESAS ··· 58 56 bool "R-Car M3-W System Controller support" if COMPILE_TEST 59 57 select SYSC_RCAR 60 58 59 + config SYSC_R8A77965 60 + bool "R-Car M3-N System Controller support" if COMPILE_TEST 61 + select SYSC_RCAR 62 + 61 63 config SYSC_R8A77970 62 64 bool "R-Car V3M System Controller support" if COMPILE_TEST 65 + select SYSC_RCAR 66 + 67 + config SYSC_R8A77980 68 + bool "R-Car V3H System Controller support" if COMPILE_TEST 63 69 select SYSC_RCAR 64 70 65 71 config SYSC_R8A77995
+2
drivers/soc/renesas/Makefile
··· 12 12 obj-$(CONFIG_SYSC_R8A7794) += r8a7794-sysc.o 13 13 obj-$(CONFIG_SYSC_R8A7795) += r8a7795-sysc.o 14 14 obj-$(CONFIG_SYSC_R8A7796) += r8a7796-sysc.o 15 + obj-$(CONFIG_SYSC_R8A77965) += r8a77965-sysc.o 15 16 obj-$(CONFIG_SYSC_R8A77970) += r8a77970-sysc.o 17 + obj-$(CONFIG_SYSC_R8A77980) += r8a77980-sysc.o 16 18 obj-$(CONFIG_SYSC_R8A77995) += r8a77995-sysc.o 17 19 18 20 # Family
+37
drivers/soc/renesas/r8a77965-sysc.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Renesas R-Car M3-N System Controller 4 + * Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org> 5 + * 6 + * Based on Renesas R-Car M3-W System Controller 7 + * Copyright (C) 2016 Glider bvba 8 + */ 9 + 10 + #include <linux/bug.h> 11 + #include <linux/kernel.h> 12 + 13 + #include <dt-bindings/power/r8a77965-sysc.h> 14 + 15 + #include "rcar-sysc.h" 16 + 17 + static const struct rcar_sysc_area r8a77965_areas[] __initconst = { 18 + { "always-on", 0, 0, R8A77965_PD_ALWAYS_ON, -1, PD_ALWAYS_ON }, 19 + { "ca57-scu", 0x1c0, 0, R8A77965_PD_CA57_SCU, R8A77965_PD_ALWAYS_ON, 20 + PD_SCU }, 21 + { "ca57-cpu0", 0x80, 0, R8A77965_PD_CA57_CPU0, R8A77965_PD_CA57_SCU, 22 + PD_CPU_NOCR }, 23 + { "ca57-cpu1", 0x80, 1, R8A77965_PD_CA57_CPU1, R8A77965_PD_CA57_SCU, 24 + PD_CPU_NOCR }, 25 + { "cr7", 0x240, 0, R8A77965_PD_CR7, R8A77965_PD_ALWAYS_ON }, 26 + { "a3vc", 0x380, 0, R8A77965_PD_A3VC, R8A77965_PD_ALWAYS_ON }, 27 + { "a3vp", 0x340, 0, R8A77965_PD_A3VP, R8A77965_PD_ALWAYS_ON }, 28 + { "a2vc1", 0x3c0, 1, R8A77965_PD_A2VC1, R8A77965_PD_A3VC }, 29 + { "3dg-a", 0x100, 0, R8A77965_PD_3DG_A, R8A77965_PD_ALWAYS_ON }, 30 + { "3dg-b", 0x100, 1, R8A77965_PD_3DG_B, R8A77965_PD_3DG_A }, 31 + { "a3ir", 0x180, 0, R8A77965_PD_A3IR, R8A77965_PD_ALWAYS_ON }, 32 + }; 33 + 34 + const struct rcar_sysc_info r8a77965_sysc_info __initconst = { 35 + .areas = r8a77965_areas, 36 + .num_areas = ARRAY_SIZE(r8a77965_areas), 37 + };
+6 -6
drivers/soc/renesas/r8a77970-sysc.c
··· 25 25 PD_CPU_NOCR }, 26 26 { "cr7", 0x240, 0, R8A77970_PD_CR7, R8A77970_PD_ALWAYS_ON }, 27 27 { "a3ir", 0x180, 0, R8A77970_PD_A3IR, R8A77970_PD_ALWAYS_ON }, 28 - { "a2ir0", 0x400, 0, R8A77970_PD_A2IR0, R8A77970_PD_ALWAYS_ON }, 29 - { "a2ir1", 0x400, 1, R8A77970_PD_A2IR1, R8A77970_PD_A2IR0 }, 30 - { "a2ir2", 0x400, 2, R8A77970_PD_A2IR2, R8A77970_PD_A2IR0 }, 31 - { "a2ir3", 0x400, 3, R8A77970_PD_A2IR3, R8A77970_PD_A2IR0 }, 32 - { "a2sc0", 0x400, 4, R8A77970_PD_A2SC0, R8A77970_PD_ALWAYS_ON }, 33 - { "a2sc1", 0x400, 5, R8A77970_PD_A2SC1, R8A77970_PD_A2SC0 }, 28 + { "a2ir0", 0x400, 0, R8A77970_PD_A2IR0, R8A77970_PD_A3IR }, 29 + { "a2ir1", 0x400, 1, R8A77970_PD_A2IR1, R8A77970_PD_A3IR }, 30 + { "a2ir2", 0x400, 2, R8A77970_PD_A2IR2, R8A77970_PD_A3IR }, 31 + { "a2ir3", 0x400, 3, R8A77970_PD_A2IR3, R8A77970_PD_A3IR }, 32 + { "a2sc0", 0x400, 4, R8A77970_PD_A2SC0, R8A77970_PD_A3IR }, 33 + { "a2sc1", 0x400, 5, R8A77970_PD_A2SC1, R8A77970_PD_A3IR }, 34 34 }; 35 35 36 36 const struct rcar_sysc_info r8a77970_sysc_info __initconst = {
+52
drivers/soc/renesas/r8a77980-sysc.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * Renesas R-Car V3H System Controller 4 + * 5 + * Copyright (C) 2018 Renesas Electronics Corp. 6 + * Copyright (C) 2018 Cogent Embedded, Inc. 7 + */ 8 + 9 + #include <linux/bug.h> 10 + #include <linux/kernel.h> 11 + 12 + #include <dt-bindings/power/r8a77980-sysc.h> 13 + 14 + #include "rcar-sysc.h" 15 + 16 + static const struct rcar_sysc_area r8a77980_areas[] __initconst = { 17 + { "always-on", 0, 0, R8A77980_PD_ALWAYS_ON, -1, PD_ALWAYS_ON }, 18 + { "ca53-scu", 0x140, 0, R8A77980_PD_CA53_SCU, R8A77980_PD_ALWAYS_ON, 19 + PD_SCU }, 20 + { "ca53-cpu0", 0x200, 0, R8A77980_PD_CA53_CPU0, R8A77980_PD_CA53_SCU, 21 + PD_CPU_NOCR }, 22 + { "ca53-cpu1", 0x200, 1, R8A77980_PD_CA53_CPU1, R8A77980_PD_CA53_SCU, 23 + PD_CPU_NOCR }, 24 + { "ca53-cpu2", 0x200, 2, R8A77980_PD_CA53_CPU2, R8A77980_PD_CA53_SCU, 25 + PD_CPU_NOCR }, 26 + { "ca53-cpu3", 0x200, 3, R8A77980_PD_CA53_CPU3, R8A77980_PD_CA53_SCU, 27 + PD_CPU_NOCR }, 28 + { "cr7", 0x240, 0, R8A77980_PD_CR7, R8A77980_PD_ALWAYS_ON }, 29 + { "a3ir", 0x180, 0, R8A77980_PD_A3IR, R8A77980_PD_ALWAYS_ON }, 30 + { "a2ir0", 0x400, 0, R8A77980_PD_A2IR0, R8A77980_PD_A3IR }, 31 + { "a2ir1", 0x400, 1, R8A77980_PD_A2IR1, R8A77980_PD_A3IR }, 32 + { "a2ir2", 0x400, 2, R8A77980_PD_A2IR2, R8A77980_PD_A3IR }, 33 + { "a2ir3", 0x400, 3, R8A77980_PD_A2IR3, R8A77980_PD_A3IR }, 34 + { "a2ir4", 0x400, 4, R8A77980_PD_A2IR4, R8A77980_PD_A3IR }, 35 + { "a2ir5", 0x400, 5, R8A77980_PD_A2IR5, R8A77980_PD_A3IR }, 36 + { "a2sc0", 0x400, 6, R8A77980_PD_A2SC0, R8A77980_PD_A3IR }, 37 + { "a2sc1", 0x400, 7, R8A77980_PD_A2SC1, R8A77980_PD_A3IR }, 38 + { "a2sc2", 0x400, 8, R8A77980_PD_A2SC2, R8A77980_PD_A3IR }, 39 + { "a2sc3", 0x400, 9, R8A77980_PD_A2SC3, R8A77980_PD_A3IR }, 40 + { "a2sc4", 0x400, 10, R8A77980_PD_A2SC4, R8A77980_PD_A3IR }, 41 + { "a2pd0", 0x400, 11, R8A77980_PD_A2PD0, R8A77980_PD_A3IR }, 42 + { "a2pd1", 0x400, 12, R8A77980_PD_A2PD1, R8A77980_PD_A3IR }, 43 + { "a2cn", 0x400, 13, R8A77980_PD_A2CN, R8A77980_PD_A3IR }, 44 + { "a3vip", 0x2c0, 0, R8A77980_PD_A3VIP, R8A77980_PD_ALWAYS_ON }, 45 + { "a3vip1", 0x300, 0, R8A77980_PD_A3VIP1, R8A77980_PD_A3VIP }, 46 + { "a3vip2", 0x280, 0, R8A77980_PD_A3VIP2, R8A77980_PD_A3VIP }, 47 + }; 48 + 49 + const struct rcar_sysc_info r8a77980_sysc_info __initconst = { 50 + .areas = r8a77980_areas, 51 + .num_areas = ARRAY_SIZE(r8a77980_areas), 52 + };
+31 -6
drivers/soc/renesas/rcar-rst.c
··· 13 13 #include <linux/of_address.h> 14 14 #include <linux/soc/renesas/rcar-rst.h> 15 15 16 + #define WDTRSTCR_RESET 0xA55A0002 17 + #define WDTRSTCR 0x0054 18 + 19 + static int rcar_rst_enable_wdt_reset(void __iomem *base) 20 + { 21 + iowrite32(WDTRSTCR_RESET, base + WDTRSTCR); 22 + return 0; 23 + } 24 + 16 25 struct rst_config { 17 - unsigned int modemr; /* Mode Monitoring Register Offset */ 26 + unsigned int modemr; /* Mode Monitoring Register Offset */ 27 + int (*configure)(void *base); /* Platform specific configuration */ 18 28 }; 19 29 20 30 static const struct rst_config rcar_rst_gen1 __initconst = { ··· 32 22 }; 33 23 34 24 static const struct rst_config rcar_rst_gen2 __initconst = { 25 + .modemr = 0x60, 26 + .configure = rcar_rst_enable_wdt_reset, 27 + }; 28 + 29 + static const struct rst_config rcar_rst_gen3 __initconst = { 35 30 .modemr = 0x60, 36 31 }; 37 32 ··· 53 38 { .compatible = "renesas,r8a7792-rst", .data = &rcar_rst_gen2 }, 54 39 { .compatible = "renesas,r8a7793-rst", .data = &rcar_rst_gen2 }, 55 40 { .compatible = "renesas,r8a7794-rst", .data = &rcar_rst_gen2 }, 56 - /* R-Car Gen3 is handled like R-Car Gen2 */ 57 - { .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen2 }, 58 - { .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen2 }, 59 - { .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen2 }, 60 - { .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen2 }, 41 + /* R-Car Gen3 */ 42 + { .compatible = "renesas,r8a7795-rst", .data = &rcar_rst_gen3 }, 43 + { .compatible = "renesas,r8a7796-rst", .data = &rcar_rst_gen3 }, 44 + { .compatible = "renesas,r8a77965-rst", .data = &rcar_rst_gen3 }, 45 + { .compatible = "renesas,r8a77970-rst", .data = &rcar_rst_gen3 }, 46 + { .compatible = "renesas,r8a77980-rst", .data = &rcar_rst_gen3 }, 47 + { .compatible = "renesas,r8a77995-rst", .data = &rcar_rst_gen3 }, 61 48 { /* sentinel */ } 62 49 }; 63 50 ··· 88 71 rcar_rst_base = base; 89 72 cfg = match->data; 90 73 saved_mode = ioread32(base + cfg->modemr); 74 + if (cfg->configure) { 75 + error = cfg->configure(base); 76 + if (error) { 77 + pr_warn("%pOF: Cannot run SoC specific configuration\n", 78 + np); 79 + goto out_put; 80 + } 81 + } 91 82 92 83 pr_debug("%pOF: MODE = 0x%08x\n", np, saved_mode); 93 84
+7 -1
drivers/soc/renesas/rcar-sysc.c
··· 254 254 pm_genpd_init(genpd, gov, false); 255 255 } 256 256 257 - static const struct of_device_id rcar_sysc_matches[] = { 257 + static const struct of_device_id rcar_sysc_matches[] __initconst = { 258 258 #ifdef CONFIG_SYSC_R8A7743 259 259 { .compatible = "renesas,r8a7743-sysc", .data = &r8a7743_sysc_info }, 260 260 #endif ··· 284 284 #ifdef CONFIG_SYSC_R8A7796 285 285 { .compatible = "renesas,r8a7796-sysc", .data = &r8a7796_sysc_info }, 286 286 #endif 287 + #ifdef CONFIG_SYSC_R8A77965 288 + { .compatible = "renesas,r8a77965-sysc", .data = &r8a77965_sysc_info }, 289 + #endif 287 290 #ifdef CONFIG_SYSC_R8A77970 288 291 { .compatible = "renesas,r8a77970-sysc", .data = &r8a77970_sysc_info }, 292 + #endif 293 + #ifdef CONFIG_SYSC_R8A77980 294 + { .compatible = "renesas,r8a77980-sysc", .data = &r8a77980_sysc_info }, 289 295 #endif 290 296 #ifdef CONFIG_SYSC_R8A77995 291 297 { .compatible = "renesas,r8a77995-sysc", .data = &r8a77995_sysc_info },
+2
drivers/soc/renesas/rcar-sysc.h
··· 58 58 extern const struct rcar_sysc_info r8a7794_sysc_info; 59 59 extern const struct rcar_sysc_info r8a7795_sysc_info; 60 60 extern const struct rcar_sysc_info r8a7796_sysc_info; 61 + extern const struct rcar_sysc_info r8a77965_sysc_info; 61 62 extern const struct rcar_sysc_info r8a77970_sysc_info; 63 + extern const struct rcar_sysc_info r8a77980_sysc_info; 62 64 extern const struct rcar_sysc_info r8a77995_sysc_info; 63 65 64 66
+16
drivers/soc/renesas/renesas-soc.c
··· 144 144 .id = 0x52, 145 145 }; 146 146 147 + static const struct renesas_soc soc_rcar_m3_n __initconst __maybe_unused = { 148 + .family = &fam_rcar_gen3, 149 + .id = 0x55, 150 + }; 151 + 147 152 static const struct renesas_soc soc_rcar_v3m __initconst __maybe_unused = { 148 153 .family = &fam_rcar_gen3, 149 154 .id = 0x54, 155 + }; 156 + 157 + static const struct renesas_soc soc_rcar_v3h __initconst __maybe_unused = { 158 + .family = &fam_rcar_gen3, 159 + .id = 0x56, 150 160 }; 151 161 152 162 static const struct renesas_soc soc_rcar_d3 __initconst __maybe_unused = { ··· 219 209 #ifdef CONFIG_ARCH_R8A7796 220 210 { .compatible = "renesas,r8a7796", .data = &soc_rcar_m3_w }, 221 211 #endif 212 + #ifdef CONFIG_ARCH_R8A77965 213 + { .compatible = "renesas,r8a77965", .data = &soc_rcar_m3_n }, 214 + #endif 222 215 #ifdef CONFIG_ARCH_R8A77970 223 216 { .compatible = "renesas,r8a77970", .data = &soc_rcar_v3m }, 217 + #endif 218 + #ifdef CONFIG_ARCH_R8A77980 219 + { .compatible = "renesas,r8a77980", .data = &soc_rcar_v3h }, 224 220 #endif 225 221 #ifdef CONFIG_ARCH_R8A77995 226 222 { .compatible = "renesas,r8a77995", .data = &soc_rcar_d3 },
+9
drivers/soc/ti/Kconfig
··· 28 28 29 29 If unsure, say N. 30 30 31 + config AMX3_PM 32 + tristate "AMx3 Power Management" 33 + depends on SOC_AM33XX || SOC_AM43XX 34 + depends on WKUP_M3_IPC && TI_EMIF_SRAM && SRAM 35 + help 36 + Enable power management on AM335x and AM437x. Required for suspend to mem 37 + and standby states on both AM335x and AM437x platforms and for deeper cpuidle 38 + c-states on AM335x. 39 + 31 40 config WKUP_M3_IPC 32 41 tristate "TI AMx3 Wkup-M3 IPC Driver" 33 42 depends on WKUP_M3_RPROC
+1
drivers/soc/ti/Makefile
··· 5 5 obj-$(CONFIG_KEYSTONE_NAVIGATOR_QMSS) += knav_qmss.o 6 6 knav_qmss-y := knav_qmss_queue.o knav_qmss_acc.o 7 7 obj-$(CONFIG_KEYSTONE_NAVIGATOR_DMA) += knav_dma.o 8 + obj-$(CONFIG_AMX3_PM) += pm33xx.o 8 9 obj-$(CONFIG_WKUP_M3_IPC) += wkup_m3_ipc.o 9 10 obj-$(CONFIG_TI_SCI_PM_DOMAINS) += ti_sci_pm_domains.o
+349
drivers/soc/ti/pm33xx.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * AM33XX Power Management Routines 4 + * 5 + * Copyright (C) 2012-2018 Texas Instruments Incorporated - http://www.ti.com/ 6 + * Vaibhav Bedia, Dave Gerlach 7 + */ 8 + 9 + #include <linux/cpu.h> 10 + #include <linux/err.h> 11 + #include <linux/genalloc.h> 12 + #include <linux/kernel.h> 13 + #include <linux/init.h> 14 + #include <linux/io.h> 15 + #include <linux/module.h> 16 + #include <linux/of.h> 17 + #include <linux/platform_data/pm33xx.h> 18 + #include <linux/platform_device.h> 19 + #include <linux/sizes.h> 20 + #include <linux/sram.h> 21 + #include <linux/suspend.h> 22 + #include <linux/ti-emif-sram.h> 23 + #include <linux/wkup_m3_ipc.h> 24 + 25 + #include <asm/proc-fns.h> 26 + #include <asm/suspend.h> 27 + #include <asm/system_misc.h> 28 + 29 + #define AMX3_PM_SRAM_SYMBOL_OFFSET(sym) ((unsigned long)(sym) - \ 30 + (unsigned long)pm_sram->do_wfi) 31 + 32 + static int (*am33xx_do_wfi_sram)(unsigned long unused); 33 + static phys_addr_t am33xx_do_wfi_sram_phys; 34 + 35 + static struct gen_pool *sram_pool, *sram_pool_data; 36 + static unsigned long ocmcram_location, ocmcram_location_data; 37 + 38 + static struct am33xx_pm_platform_data *pm_ops; 39 + static struct am33xx_pm_sram_addr *pm_sram; 40 + 41 + static struct device *pm33xx_dev; 42 + static struct wkup_m3_ipc *m3_ipc; 43 + 44 + static u32 sram_suspend_address(unsigned long addr) 45 + { 46 + return ((unsigned long)am33xx_do_wfi_sram + 47 + AMX3_PM_SRAM_SYMBOL_OFFSET(addr)); 48 + } 49 + 50 + #ifdef CONFIG_SUSPEND 51 + static int am33xx_pm_suspend(suspend_state_t suspend_state) 52 + { 53 + int i, ret = 0; 54 + 55 + ret = pm_ops->soc_suspend((unsigned long)suspend_state, 56 + am33xx_do_wfi_sram); 57 + 58 + if (ret) { 59 + dev_err(pm33xx_dev, "PM: Kernel suspend failure\n"); 60 + } else { 61 + i = m3_ipc->ops->request_pm_status(m3_ipc); 62 + 63 + switch (i) { 64 + case 0: 65 + dev_info(pm33xx_dev, 66 + "PM: Successfully put all powerdomains to target state\n"); 67 + break; 68 + case 1: 69 + dev_err(pm33xx_dev, 70 + "PM: Could not transition all powerdomains to target state\n"); 71 + ret = -1; 72 + break; 73 + default: 74 + dev_err(pm33xx_dev, 75 + "PM: CM3 returned unknown result = %d\n", i); 76 + ret = -1; 77 + } 78 + } 79 + 80 + return ret; 81 + } 82 + 83 + static int am33xx_pm_enter(suspend_state_t suspend_state) 84 + { 85 + int ret = 0; 86 + 87 + switch (suspend_state) { 88 + case PM_SUSPEND_MEM: 89 + case PM_SUSPEND_STANDBY: 90 + ret = am33xx_pm_suspend(suspend_state); 91 + break; 92 + default: 93 + ret = -EINVAL; 94 + } 95 + 96 + return ret; 97 + } 98 + 99 + static int am33xx_pm_begin(suspend_state_t state) 100 + { 101 + int ret = -EINVAL; 102 + 103 + switch (state) { 104 + case PM_SUSPEND_MEM: 105 + ret = m3_ipc->ops->prepare_low_power(m3_ipc, WKUP_M3_DEEPSLEEP); 106 + break; 107 + case PM_SUSPEND_STANDBY: 108 + ret = m3_ipc->ops->prepare_low_power(m3_ipc, WKUP_M3_STANDBY); 109 + break; 110 + } 111 + 112 + return ret; 113 + } 114 + 115 + static void am33xx_pm_end(void) 116 + { 117 + m3_ipc->ops->finish_low_power(m3_ipc); 118 + } 119 + 120 + static int am33xx_pm_valid(suspend_state_t state) 121 + { 122 + switch (state) { 123 + case PM_SUSPEND_STANDBY: 124 + case PM_SUSPEND_MEM: 125 + return 1; 126 + default: 127 + return 0; 128 + } 129 + } 130 + 131 + static const struct platform_suspend_ops am33xx_pm_ops = { 132 + .begin = am33xx_pm_begin, 133 + .end = am33xx_pm_end, 134 + .enter = am33xx_pm_enter, 135 + .valid = am33xx_pm_valid, 136 + }; 137 + #endif /* CONFIG_SUSPEND */ 138 + 139 + static void am33xx_pm_set_ipc_ops(void) 140 + { 141 + u32 resume_address; 142 + int temp; 143 + 144 + temp = ti_emif_get_mem_type(); 145 + if (temp < 0) { 146 + dev_err(pm33xx_dev, "PM: Cannot determine memory type, no PM available\n"); 147 + return; 148 + } 149 + m3_ipc->ops->set_mem_type(m3_ipc, temp); 150 + 151 + /* Physical resume address to be used by ROM code */ 152 + resume_address = am33xx_do_wfi_sram_phys + 153 + *pm_sram->resume_offset + 0x4; 154 + 155 + m3_ipc->ops->set_resume_address(m3_ipc, (void *)resume_address); 156 + } 157 + 158 + static void am33xx_pm_free_sram(void) 159 + { 160 + gen_pool_free(sram_pool, ocmcram_location, *pm_sram->do_wfi_sz); 161 + gen_pool_free(sram_pool_data, ocmcram_location_data, 162 + sizeof(struct am33xx_pm_ro_sram_data)); 163 + } 164 + 165 + /* 166 + * Push the minimal suspend-resume code to SRAM 167 + */ 168 + static int am33xx_pm_alloc_sram(void) 169 + { 170 + struct device_node *np; 171 + int ret = 0; 172 + 173 + np = of_find_compatible_node(NULL, NULL, "ti,omap3-mpu"); 174 + if (!np) { 175 + np = of_find_compatible_node(NULL, NULL, "ti,omap4-mpu"); 176 + if (!np) { 177 + dev_err(pm33xx_dev, "PM: %s: Unable to find device node for mpu\n", 178 + __func__); 179 + return -ENODEV; 180 + } 181 + } 182 + 183 + sram_pool = of_gen_pool_get(np, "pm-sram", 0); 184 + if (!sram_pool) { 185 + dev_err(pm33xx_dev, "PM: %s: Unable to get sram pool for ocmcram\n", 186 + __func__); 187 + ret = -ENODEV; 188 + goto mpu_put_node; 189 + } 190 + 191 + sram_pool_data = of_gen_pool_get(np, "pm-sram", 1); 192 + if (!sram_pool_data) { 193 + dev_err(pm33xx_dev, "PM: %s: Unable to get sram data pool for ocmcram\n", 194 + __func__); 195 + ret = -ENODEV; 196 + goto mpu_put_node; 197 + } 198 + 199 + ocmcram_location = gen_pool_alloc(sram_pool, *pm_sram->do_wfi_sz); 200 + if (!ocmcram_location) { 201 + dev_err(pm33xx_dev, "PM: %s: Unable to allocate memory from ocmcram\n", 202 + __func__); 203 + ret = -ENOMEM; 204 + goto mpu_put_node; 205 + } 206 + 207 + ocmcram_location_data = gen_pool_alloc(sram_pool_data, 208 + sizeof(struct emif_regs_amx3)); 209 + if (!ocmcram_location_data) { 210 + dev_err(pm33xx_dev, "PM: Unable to allocate memory from ocmcram\n"); 211 + gen_pool_free(sram_pool, ocmcram_location, *pm_sram->do_wfi_sz); 212 + ret = -ENOMEM; 213 + } 214 + 215 + mpu_put_node: 216 + of_node_put(np); 217 + return ret; 218 + } 219 + 220 + static int am33xx_push_sram_idle(void) 221 + { 222 + struct am33xx_pm_ro_sram_data ro_sram_data; 223 + int ret; 224 + u32 table_addr, ro_data_addr; 225 + void *copy_addr; 226 + 227 + ro_sram_data.amx3_pm_sram_data_virt = ocmcram_location_data; 228 + ro_sram_data.amx3_pm_sram_data_phys = 229 + gen_pool_virt_to_phys(sram_pool_data, ocmcram_location_data); 230 + 231 + /* Save physical address to calculate resume offset during pm init */ 232 + am33xx_do_wfi_sram_phys = gen_pool_virt_to_phys(sram_pool, 233 + ocmcram_location); 234 + 235 + am33xx_do_wfi_sram = sram_exec_copy(sram_pool, (void *)ocmcram_location, 236 + pm_sram->do_wfi, 237 + *pm_sram->do_wfi_sz); 238 + if (!am33xx_do_wfi_sram) { 239 + dev_err(pm33xx_dev, 240 + "PM: %s: am33xx_do_wfi copy to sram failed\n", 241 + __func__); 242 + return -ENODEV; 243 + } 244 + 245 + table_addr = 246 + sram_suspend_address((unsigned long)pm_sram->emif_sram_table); 247 + ret = ti_emif_copy_pm_function_table(sram_pool, (void *)table_addr); 248 + if (ret) { 249 + dev_dbg(pm33xx_dev, 250 + "PM: %s: EMIF function copy failed\n", __func__); 251 + return -EPROBE_DEFER; 252 + } 253 + 254 + ro_data_addr = 255 + sram_suspend_address((unsigned long)pm_sram->ro_sram_data); 256 + copy_addr = sram_exec_copy(sram_pool, (void *)ro_data_addr, 257 + &ro_sram_data, 258 + sizeof(ro_sram_data)); 259 + if (!copy_addr) { 260 + dev_err(pm33xx_dev, 261 + "PM: %s: ro_sram_data copy to sram failed\n", 262 + __func__); 263 + return -ENODEV; 264 + } 265 + 266 + return 0; 267 + } 268 + 269 + static int am33xx_pm_probe(struct platform_device *pdev) 270 + { 271 + struct device *dev = &pdev->dev; 272 + int ret; 273 + 274 + if (!of_machine_is_compatible("ti,am33xx") && 275 + !of_machine_is_compatible("ti,am43")) 276 + return -ENODEV; 277 + 278 + pm_ops = dev->platform_data; 279 + if (!pm_ops) { 280 + dev_err(dev, "PM: Cannot get core PM ops!\n"); 281 + return -ENODEV; 282 + } 283 + 284 + pm_sram = pm_ops->get_sram_addrs(); 285 + if (!pm_sram) { 286 + dev_err(dev, "PM: Cannot get PM asm function addresses!!\n"); 287 + return -ENODEV; 288 + } 289 + 290 + pm33xx_dev = dev; 291 + 292 + ret = am33xx_pm_alloc_sram(); 293 + if (ret) 294 + return ret; 295 + 296 + ret = am33xx_push_sram_idle(); 297 + if (ret) 298 + goto err_free_sram; 299 + 300 + m3_ipc = wkup_m3_ipc_get(); 301 + if (!m3_ipc) { 302 + dev_dbg(dev, "PM: Cannot get wkup_m3_ipc handle\n"); 303 + ret = -EPROBE_DEFER; 304 + goto err_free_sram; 305 + } 306 + 307 + am33xx_pm_set_ipc_ops(); 308 + 309 + #ifdef CONFIG_SUSPEND 310 + suspend_set_ops(&am33xx_pm_ops); 311 + #endif /* CONFIG_SUSPEND */ 312 + 313 + ret = pm_ops->init(); 314 + if (ret) { 315 + dev_err(dev, "Unable to call core pm init!\n"); 316 + ret = -ENODEV; 317 + goto err_put_wkup_m3_ipc; 318 + } 319 + 320 + return 0; 321 + 322 + err_put_wkup_m3_ipc: 323 + wkup_m3_ipc_put(m3_ipc); 324 + err_free_sram: 325 + am33xx_pm_free_sram(); 326 + pm33xx_dev = NULL; 327 + return ret; 328 + } 329 + 330 + static int am33xx_pm_remove(struct platform_device *pdev) 331 + { 332 + suspend_set_ops(NULL); 333 + wkup_m3_ipc_put(m3_ipc); 334 + am33xx_pm_free_sram(); 335 + return 0; 336 + } 337 + 338 + static struct platform_driver am33xx_pm_driver = { 339 + .driver = { 340 + .name = "pm33xx", 341 + }, 342 + .probe = am33xx_pm_probe, 343 + .remove = am33xx_pm_remove, 344 + }; 345 + module_platform_driver(am33xx_pm_driver); 346 + 347 + MODULE_ALIAS("platform:pm33xx"); 348 + MODULE_LICENSE("GPL v2"); 349 + MODULE_DESCRIPTION("am33xx power management driver");
+30
include/dt-bindings/power/r8a77965-sysc.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Copyright (C) 2018 Jacopo Mondi <jacopo+renesas@jmondi.org> 4 + * Copyright (C) 2016 Glider bvba 5 + */ 6 + 7 + #ifndef __DT_BINDINGS_POWER_R8A77965_SYSC_H__ 8 + #define __DT_BINDINGS_POWER_R8A77965_SYSC_H__ 9 + 10 + /* 11 + * These power domain indices match the numbers of the interrupt bits 12 + * representing the power areas in the various Interrupt Registers 13 + * (e.g. SYSCISR, Interrupt Status Register) 14 + */ 15 + 16 + #define R8A77965_PD_CA57_CPU0 0 17 + #define R8A77965_PD_CA57_CPU1 1 18 + #define R8A77965_PD_A3VP 9 19 + #define R8A77965_PD_CA57_SCU 12 20 + #define R8A77965_PD_CR7 13 21 + #define R8A77965_PD_A3VC 14 22 + #define R8A77965_PD_3DG_A 17 23 + #define R8A77965_PD_3DG_B 18 24 + #define R8A77965_PD_A3IR 24 25 + #define R8A77965_PD_A2VC1 26 26 + 27 + /* Always-on power area */ 28 + #define R8A77965_PD_ALWAYS_ON 32 29 + 30 + #endif /* __DT_BINDINGS_POWER_R8A77965_SYSC_H__ */
+43
include/dt-bindings/power/r8a77980-sysc.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 2 + * 3 + * Copyright (C) 2018 Renesas Electronics Corp. 4 + * Copyright (C) 2018 Cogent Embedded, Inc. 5 + */ 6 + #ifndef __DT_BINDINGS_POWER_R8A77980_SYSC_H__ 7 + #define __DT_BINDINGS_POWER_R8A77980_SYSC_H__ 8 + 9 + /* 10 + * These power domain indices match the numbers of the interrupt bits 11 + * representing the power areas in the various Interrupt Registers 12 + * (e.g. SYSCISR, Interrupt Status Register) 13 + */ 14 + 15 + #define R8A77980_PD_A2SC2 0 16 + #define R8A77980_PD_A2SC3 1 17 + #define R8A77980_PD_A2SC4 2 18 + #define R8A77980_PD_A2PD0 3 19 + #define R8A77980_PD_A2PD1 4 20 + #define R8A77980_PD_CA53_CPU0 5 21 + #define R8A77980_PD_CA53_CPU1 6 22 + #define R8A77980_PD_CA53_CPU2 7 23 + #define R8A77980_PD_CA53_CPU3 8 24 + #define R8A77980_PD_A2CN 10 25 + #define R8A77980_PD_A3VIP 11 26 + #define R8A77980_PD_A2IR5 12 27 + #define R8A77980_PD_CR7 13 28 + #define R8A77980_PD_A2IR4 15 29 + #define R8A77980_PD_CA53_SCU 21 30 + #define R8A77980_PD_A2IR0 23 31 + #define R8A77980_PD_A3IR 24 32 + #define R8A77980_PD_A3VIP1 25 33 + #define R8A77980_PD_A3VIP2 26 34 + #define R8A77980_PD_A2IR1 27 35 + #define R8A77980_PD_A2IR2 28 36 + #define R8A77980_PD_A2IR3 29 37 + #define R8A77980_PD_A2SC0 30 38 + #define R8A77980_PD_A2SC1 31 39 + 40 + /* Always-on power area */ 41 + #define R8A77980_PD_ALWAYS_ON 32 42 + 43 + #endif /* __DT_BINDINGS_POWER_R8A77980_SYSC_H__ */
+1
include/linux/clk/ti.h
··· 203 203 TI_CLKM_PRM, 204 204 TI_CLKM_SCRM, 205 205 TI_CLKM_CTRL, 206 + TI_CLKM_CTRL_AUX, 206 207 TI_CLKM_PLLSS, 207 208 CLK_MAX_MEMMAPS 208 209 };
-12
include/linux/platform_data/asoc-ti-mcbsp.h
··· 25 25 #include <linux/spinlock.h> 26 26 #include <linux/clk.h> 27 27 28 - #define MCBSP_CONFIG_TYPE2 0x2 29 - #define MCBSP_CONFIG_TYPE3 0x3 30 - #define MCBSP_CONFIG_TYPE4 0x4 31 - 32 28 /* Platform specific configuration */ 33 29 struct omap_mcbsp_ops { 34 30 void (*request)(unsigned int); ··· 41 45 bool has_wakeup; /* Wakeup capability */ 42 46 bool has_ccr; /* Transceiver has configuration control registers */ 43 47 int (*force_ick_on)(struct clk *clk, bool force_on); 44 - }; 45 - 46 - /** 47 - * omap_mcbsp_dev_attr - OMAP McBSP device attributes for omap_hwmod 48 - * @sidetone: name of the sidetone device 49 - */ 50 - struct omap_mcbsp_dev_attr { 51 - const char *sidetone; 52 48 }; 53 49 54 50 void omap3_mcbsp_init_pdata_callback(struct omap_mcbsp_platform_data *pdata);
+38
include/linux/platform_data/dmtimer-omap.h
··· 20 20 #ifndef __PLATFORM_DATA_DMTIMER_OMAP_H__ 21 21 #define __PLATFORM_DATA_DMTIMER_OMAP_H__ 22 22 23 + struct omap_dm_timer_ops { 24 + struct omap_dm_timer *(*request_by_node)(struct device_node *np); 25 + struct omap_dm_timer *(*request_specific)(int timer_id); 26 + struct omap_dm_timer *(*request)(void); 27 + 28 + int (*free)(struct omap_dm_timer *timer); 29 + 30 + void (*enable)(struct omap_dm_timer *timer); 31 + void (*disable)(struct omap_dm_timer *timer); 32 + 33 + int (*get_irq)(struct omap_dm_timer *timer); 34 + int (*set_int_enable)(struct omap_dm_timer *timer, 35 + unsigned int value); 36 + int (*set_int_disable)(struct omap_dm_timer *timer, u32 mask); 37 + 38 + struct clk *(*get_fclk)(struct omap_dm_timer *timer); 39 + 40 + int (*start)(struct omap_dm_timer *timer); 41 + int (*stop)(struct omap_dm_timer *timer); 42 + int (*set_source)(struct omap_dm_timer *timer, int source); 43 + 44 + int (*set_load)(struct omap_dm_timer *timer, int autoreload, 45 + unsigned int value); 46 + int (*set_match)(struct omap_dm_timer *timer, int enable, 47 + unsigned int match); 48 + int (*set_pwm)(struct omap_dm_timer *timer, int def_on, 49 + int toggle, int trigger); 50 + int (*set_prescaler)(struct omap_dm_timer *timer, int prescaler); 51 + 52 + unsigned int (*read_counter)(struct omap_dm_timer *timer); 53 + int (*write_counter)(struct omap_dm_timer *timer, 54 + unsigned int value); 55 + unsigned int (*read_status)(struct omap_dm_timer *timer); 56 + int (*write_status)(struct omap_dm_timer *timer, 57 + unsigned int value); 58 + }; 59 + 23 60 struct dmtimer_platform_data { 24 61 /* set_timer_src - Only used for OMAP1 devices */ 25 62 int (*set_timer_src)(struct platform_device *pdev, int source); 26 63 u32 timer_capability; 27 64 u32 timer_errata; 28 65 int (*get_context_loss_count)(struct device *); 66 + const struct omap_dm_timer_ops *timer_ops; 29 67 }; 30 68 31 69 #endif /* __PLATFORM_DATA_DMTIMER_OMAP_H__ */
-5
include/linux/platform_data/gpio-omap.h
··· 157 157 #define OMAP_MPUIO(nr) (OMAP_MAX_GPIO_LINES + (nr)) 158 158 #define OMAP_GPIO_IS_MPUIO(nr) ((nr) >= OMAP_MAX_GPIO_LINES) 159 159 160 - struct omap_gpio_dev_attr { 161 - int bank_width; /* GPIO bank width */ 162 - bool dbck_flag; /* dbck required or not - True for OMAP3&4 */ 163 - }; 164 - 165 160 struct omap_gpio_reg_offs { 166 161 u16 revision; 167 162 u16 direction;
+12 -31
include/linux/platform_data/mtd-nand-pxa3xx.h
··· 6 6 #include <linux/mtd/partitions.h> 7 7 8 8 /* 9 - * Current pxa3xx_nand controller has two chip select which 10 - * both be workable. 11 - * 12 - * Notice should be taken that: 13 - * When you want to use this feature, you should not enable the 14 - * keep configuration feature, for two chip select could be 15 - * attached with different nand chip. The different page size 16 - * and timing requirement make the keep configuration impossible. 9 + * Current pxa3xx_nand controller has two chip select which both be workable but 10 + * historically all platforms remaining on platform data used only one. Switch 11 + * to device tree if you need more. 17 12 */ 18 - 19 - /* The max num of chip select current support */ 20 - #define NUM_CHIP_SELECT (2) 21 13 struct pxa3xx_nand_platform_data { 22 - 23 - /* the data flash bus is shared between the Static Memory 24 - * Controller and the Data Flash Controller, the arbiter 25 - * controls the ownership of the bus 26 - */ 27 - int enable_arbiter; 28 - 29 - /* allow platform code to keep OBM/bootloader defined NFC config */ 30 - int keep_config; 31 - 32 - /* indicate how many chip selects will be used */ 33 - int num_cs; 34 - 35 - /* use an flash-based bad block table */ 36 - bool flash_bbt; 37 - 38 - /* requested ECC strength and ECC step size */ 14 + /* Keep OBM/bootloader NFC timing configuration */ 15 + bool keep_config; 16 + /* Use a flash-based bad block table */ 17 + bool flash_bbt; 18 + /* Requested ECC strength and ECC step size */ 39 19 int ecc_strength, ecc_step_size; 40 - 41 - const struct mtd_partition *parts[NUM_CHIP_SELECT]; 42 - unsigned int nr_parts[NUM_CHIP_SELECT]; 20 + /* Partitions */ 21 + const struct mtd_partition *parts; 22 + unsigned int nr_parts; 43 23 }; 44 24 45 25 extern void pxa3xx_set_nand_info(struct pxa3xx_nand_platform_data *info); 26 + 46 27 #endif /* __ASM_ARCH_PXA3XX_NAND_H */
+21
include/linux/platform_data/phy-da8xx-usb.h
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* 3 + * phy-da8xx-usb - TI DaVinci DA8xx USB PHY driver 4 + * 5 + * Copyright (C) 2018 David Lechner <david@lechnology.com> 6 + */ 7 + 8 + #ifndef __LINUX_PLATFORM_DATA_PHY_DA8XX_USB_H__ 9 + #define __LINUX_PLATFORM_DATA_PHY_DA8XX_USB_H__ 10 + 11 + #include <linux/regmap.h> 12 + 13 + /** 14 + * da8xx_usb_phy_platform_data 15 + * @cfgchip: CFGCHIP syscon regmap 16 + */ 17 + struct da8xx_usb_phy_platform_data { 18 + struct regmap *cfgchip; 19 + }; 20 + 21 + #endif /* __LINUX_PLATFORM_DATA_PHY_DA8XX_USB_H__ */
+42
include/linux/platform_data/pm33xx.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * TI pm33xx platform data 4 + * 5 + * Copyright (C) 2016-2018 Texas Instruments, Inc. 6 + * Dave Gerlach <d-gerlach@ti.com> 7 + */ 8 + 9 + #ifndef _LINUX_PLATFORM_DATA_PM33XX_H 10 + #define _LINUX_PLATFORM_DATA_PM33XX_H 11 + 12 + #include <linux/kbuild.h> 13 + #include <linux/types.h> 14 + 15 + #ifndef __ASSEMBLER__ 16 + struct am33xx_pm_sram_addr { 17 + void (*do_wfi)(void); 18 + unsigned long *do_wfi_sz; 19 + unsigned long *resume_offset; 20 + unsigned long *emif_sram_table; 21 + unsigned long *ro_sram_data; 22 + }; 23 + 24 + struct am33xx_pm_platform_data { 25 + int (*init)(void); 26 + int (*soc_suspend)(unsigned int state, int (*fn)(unsigned long)); 27 + struct am33xx_pm_sram_addr *(*get_sram_addrs)(void); 28 + }; 29 + 30 + struct am33xx_pm_sram_data { 31 + u32 wfi_flags; 32 + u32 l2_aux_ctrl_val; 33 + u32 l2_prefetch_ctrl_val; 34 + } __packed __aligned(8); 35 + 36 + struct am33xx_pm_ro_sram_data { 37 + u32 amx3_pm_sram_data_virt; 38 + u32 amx3_pm_sram_data_phys; 39 + } __packed __aligned(8); 40 + 41 + #endif /* __ASSEMBLER__ */ 42 + #endif /* _LINUX_PLATFORM_DATA_PM33XX_H */
-8
include/linux/platform_data/spi-omap2-mcspi.h
··· 2 2 #ifndef _OMAP2_MCSPI_H 3 3 #define _OMAP2_MCSPI_H 4 4 5 - #define OMAP2_MCSPI_REV 0 6 - #define OMAP3_MCSPI_REV 1 7 - #define OMAP4_MCSPI_REV 2 8 - 9 5 #define OMAP4_MCSPI_REG_OFFSET 0x100 10 6 11 7 #define MCSPI_PINDIR_D0_IN_D1_OUT 0 ··· 11 15 unsigned short num_cs; 12 16 unsigned int regs_offset; 13 17 unsigned int pin_dir:1; 14 - }; 15 - 16 - struct omap2_mcspi_dev_attr { 17 - unsigned short num_chipselect; 18 18 }; 19 19 20 20 struct omap2_mcspi_device_config {
+50
include/linux/platform_data/ti-sysc.h
··· 16 16 TI_SYSC_OMAP4_USB_HOST_FS, 17 17 }; 18 18 19 + struct ti_sysc_cookie { 20 + void *data; 21 + }; 22 + 19 23 /** 20 24 * struct sysc_regbits - TI OCP_SYSCONFIG register field offsets 21 25 * @midle_shift: Offset of the midle bit ··· 45 41 s8 emufree_shift; 46 42 }; 47 43 44 + #define SYSC_QUIRK_LEGACY_IDLE BIT(8) 48 45 #define SYSC_QUIRK_RESET_STATUS BIT(7) 49 46 #define SYSC_QUIRK_NO_IDLE_ON_INIT BIT(6) 50 47 #define SYSC_QUIRK_NO_RESET_ON_INIT BIT(5) ··· 86 81 u8 sidlemodes; 87 82 u8 srst_udelay; 88 83 u32 quirks; 84 + }; 85 + 86 + enum sysc_registers { 87 + SYSC_REVISION, 88 + SYSC_SYSCONFIG, 89 + SYSC_SYSSTATUS, 90 + SYSC_MAX_REGS, 91 + }; 92 + 93 + /** 94 + * struct ti_sysc_module_data - ti-sysc to hwmod translation data for a module 95 + * @name: legacy "ti,hwmods" module name 96 + * @module_pa: physical address of the interconnect target module 97 + * @module_size: size of the interconnect target module 98 + * @offsets: array of register offsets as listed in enum sysc_registers 99 + * @nr_offsets: number of registers 100 + * @cap: interconnect target module capabilities 101 + * @cfg: interconnect target module configuration 102 + * 103 + * This data is enough to allocate a new struct omap_hwmod_class_sysconfig 104 + * based on device tree data parsed by ti-sysc driver. 105 + */ 106 + struct ti_sysc_module_data { 107 + const char *name; 108 + u64 module_pa; 109 + u32 module_size; 110 + int *offsets; 111 + int nr_offsets; 112 + const struct sysc_capabilities *cap; 113 + struct sysc_config *cfg; 114 + }; 115 + 116 + struct device; 117 + 118 + struct ti_sysc_platform_data { 119 + struct of_dev_auxdata *auxdata; 120 + int (*init_module)(struct device *dev, 121 + const struct ti_sysc_module_data *data, 122 + struct ti_sysc_cookie *cookie); 123 + int (*enable_module)(struct device *dev, 124 + const struct ti_sysc_cookie *cookie); 125 + int (*idle_module)(struct device *dev, 126 + const struct ti_sysc_cookie *cookie); 127 + int (*shutdown_module)(struct device *dev, 128 + const struct ti_sysc_cookie *cookie); 89 129 }; 90 130 91 131 #endif /* __TI_SYSC_DATA_H__ */
+9 -1
include/linux/power/smartreflex.h
··· 143 143 #define OMAP3430_SR_ERRWEIGHT 0x04 144 144 #define OMAP3430_SR_ERRMAXLIMIT 0x02 145 145 146 + enum sr_instance { 147 + OMAP_SR_MPU, /* shared with iva on omap3 */ 148 + OMAP_SR_CORE, 149 + OMAP_SR_IVA, 150 + OMAP_SR_NR, 151 + }; 152 + 146 153 struct omap_sr { 147 154 char *name; 148 155 struct list_head node; ··· 214 207 const char *sensor_voltdm_name; 215 208 }; 216 209 217 - #ifdef CONFIG_POWER_AVS_OMAP 218 210 /* 219 211 * The smart reflex driver supports CLASS1 CLASS2 and CLASS3 SR. 220 212 * The smartreflex class driver should pass the class type. ··· 295 289 struct omap_sr_nvalue_table *nvalue_table; 296 290 struct voltagedomain *voltdm; 297 291 }; 292 + 293 + #ifdef CONFIG_POWER_AVS_OMAP 298 294 299 295 /* Smartreflex module enable/disable interface */ 300 296 void omap_sr_enable(struct voltagedomain *voltdm);
+2 -15
include/linux/serial_s3c.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0+ */ 1 2 /* 2 3 * Internal header file for Samsung S3C2410 serial ports (UART0-2) 3 4 * ··· 11 10 * Internal header file for MX1ADS serial ports (UART1 & 2) 12 11 * 13 12 * Copyright (C) 2002 Shane Nay (shane@minirl.com) 14 - * 15 - * This program is free software; you can redistribute it and/or modify 16 - * it under the terms of the GNU General Public License as published by 17 - * the Free Software Foundation; either version 2 of the License, or 18 - * (at your option) any later version. 19 - * 20 - * This program is distributed in the hope that it will be useful, 21 - * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 - * GNU General Public License for more details. 24 - * 25 - * You should have received a copy of the GNU General Public License 26 - * along with this program; if not, write to the Free Software 27 - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 28 - */ 13 + */ 29 14 30 15 #ifndef __ASM_ARM_REGS_SERIAL_H 31 16 #define __ASM_ARM_REGS_SERIAL_H