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

hwspinlock: remove sirf driver

The CSR SiRF prima2/atlas platforms are getting removed, so this driver
is no longer needed.

Cc: Barry Song <baohua@kernel.org>
Link: https://lore.kernel.org/linux-arm-kernel/20210120124812.2800027-1-arnd@kernel.org/T/
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20210120132537.2285157-1-arnd@kernel.org
Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>

authored by

Arnd Bergmann and committed by
Bjorn Andersson
1cb8f3e2 a38fd874

-145
-28
Documentation/devicetree/bindings/hwlock/sirf,hwspinlock.txt
··· 1 - SIRF Hardware spinlock device Binding 2 - ----------------------------------------------- 3 - 4 - Required properties : 5 - - compatible : shall contain only one of the following: 6 - "sirf,hwspinlock" 7 - 8 - - reg : the register address of hwspinlock 9 - 10 - - #hwlock-cells : hwlock users only use the hwlock id to represent a specific 11 - hwlock, so the number of cells should be <1> here. 12 - 13 - Please look at the generic hwlock binding for usage information for consumers, 14 - "Documentation/devicetree/bindings/hwlock/hwlock.txt" 15 - 16 - Example of hwlock provider: 17 - hwlock { 18 - compatible = "sirf,hwspinlock"; 19 - reg = <0x13240000 0x00010000>; 20 - #hwlock-cells = <1>; 21 - }; 22 - 23 - Example of hwlock users: 24 - node { 25 - ... 26 - hwlocks = <&hwlock 2>; 27 - ... 28 - };
-11
drivers/hwspinlock/Kconfig
··· 28 28 29 29 If unsure, say N. 30 30 31 - config HWSPINLOCK_SIRF 32 - tristate "SIRF Hardware Spinlock device" 33 - depends on ARCH_SIRF || COMPILE_TEST 34 - help 35 - Say y here to support the SIRF Hardware Spinlock device, which 36 - provides a synchronisation mechanism for the various processors 37 - on the SoC. 38 - 39 - It's safe to say n here if you're not interested in SIRF hardware 40 - spinlock or just want a bare minimum kernel. 41 - 42 31 config HWSPINLOCK_SPRD 43 32 tristate "SPRD Hardware Spinlock device" 44 33 depends on ARCH_SPRD || COMPILE_TEST
-1
drivers/hwspinlock/Makefile
··· 6 6 obj-$(CONFIG_HWSPINLOCK) += hwspinlock_core.o 7 7 obj-$(CONFIG_HWSPINLOCK_OMAP) += omap_hwspinlock.o 8 8 obj-$(CONFIG_HWSPINLOCK_QCOM) += qcom_hwspinlock.o 9 - obj-$(CONFIG_HWSPINLOCK_SIRF) += sirf_hwspinlock.o 10 9 obj-$(CONFIG_HWSPINLOCK_SPRD) += sprd_hwspinlock.o 11 10 obj-$(CONFIG_HWSPINLOCK_STM32) += stm32_hwspinlock.o 12 11 obj-$(CONFIG_HSEM_U8500) += u8500_hsem.o
-105
drivers/hwspinlock/sirf_hwspinlock.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 2 - /* 3 - * SIRF hardware spinlock driver 4 - * 5 - * Copyright (c) 2015 Cambridge Silicon Radio Limited, a CSR plc group company. 6 - */ 7 - 8 - #include <linux/kernel.h> 9 - #include <linux/module.h> 10 - #include <linux/device.h> 11 - #include <linux/io.h> 12 - #include <linux/slab.h> 13 - #include <linux/spinlock.h> 14 - #include <linux/hwspinlock.h> 15 - #include <linux/platform_device.h> 16 - #include <linux/of.h> 17 - #include <linux/of_address.h> 18 - 19 - #include "hwspinlock_internal.h" 20 - 21 - struct sirf_hwspinlock { 22 - void __iomem *io_base; 23 - struct hwspinlock_device bank; 24 - }; 25 - 26 - /* Number of Hardware Spinlocks*/ 27 - #define HW_SPINLOCK_NUMBER 30 28 - 29 - /* Hardware spinlock register offsets */ 30 - #define HW_SPINLOCK_BASE 0x404 31 - #define HW_SPINLOCK_OFFSET(x) (HW_SPINLOCK_BASE + 0x4 * (x)) 32 - 33 - static int sirf_hwspinlock_trylock(struct hwspinlock *lock) 34 - { 35 - void __iomem *lock_addr = lock->priv; 36 - 37 - /* attempt to acquire the lock by reading value == 1 from it */ 38 - return !!readl(lock_addr); 39 - } 40 - 41 - static void sirf_hwspinlock_unlock(struct hwspinlock *lock) 42 - { 43 - void __iomem *lock_addr = lock->priv; 44 - 45 - /* release the lock by writing 0 to it */ 46 - writel(0, lock_addr); 47 - } 48 - 49 - static const struct hwspinlock_ops sirf_hwspinlock_ops = { 50 - .trylock = sirf_hwspinlock_trylock, 51 - .unlock = sirf_hwspinlock_unlock, 52 - }; 53 - 54 - static int sirf_hwspinlock_probe(struct platform_device *pdev) 55 - { 56 - struct sirf_hwspinlock *hwspin; 57 - struct hwspinlock *hwlock; 58 - int idx; 59 - 60 - if (!pdev->dev.of_node) 61 - return -ENODEV; 62 - 63 - hwspin = devm_kzalloc(&pdev->dev, 64 - struct_size(hwspin, bank.lock, 65 - HW_SPINLOCK_NUMBER), 66 - GFP_KERNEL); 67 - if (!hwspin) 68 - return -ENOMEM; 69 - 70 - /* retrieve io base */ 71 - hwspin->io_base = devm_platform_ioremap_resource(pdev, 0); 72 - if (IS_ERR(hwspin->io_base)) 73 - return PTR_ERR(hwspin->io_base); 74 - 75 - for (idx = 0; idx < HW_SPINLOCK_NUMBER; idx++) { 76 - hwlock = &hwspin->bank.lock[idx]; 77 - hwlock->priv = hwspin->io_base + HW_SPINLOCK_OFFSET(idx); 78 - } 79 - 80 - platform_set_drvdata(pdev, hwspin); 81 - 82 - return devm_hwspin_lock_register(&pdev->dev, &hwspin->bank, 83 - &sirf_hwspinlock_ops, 0, 84 - HW_SPINLOCK_NUMBER); 85 - } 86 - 87 - static const struct of_device_id sirf_hwpinlock_ids[] = { 88 - { .compatible = "sirf,hwspinlock", }, 89 - {}, 90 - }; 91 - MODULE_DEVICE_TABLE(of, sirf_hwpinlock_ids); 92 - 93 - static struct platform_driver sirf_hwspinlock_driver = { 94 - .probe = sirf_hwspinlock_probe, 95 - .driver = { 96 - .name = "atlas7_hwspinlock", 97 - .of_match_table = sirf_hwpinlock_ids, 98 - }, 99 - }; 100 - 101 - module_platform_driver(sirf_hwspinlock_driver); 102 - 103 - MODULE_LICENSE("GPL v2"); 104 - MODULE_DESCRIPTION("SIRF Hardware spinlock driver"); 105 - MODULE_AUTHOR("Wei Chen <wei.chen@csr.com>");