Lines Matching +full:stm32 +full:- +full:etzpc
1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2023, STMicroelectronics - All Rights Reserved
22 * ETZPC registers
36 * ETZPC miscellaneous
48 if (firewall_id >= ctrl->max_entries) { in stm32_etzpc_grant_access()
49 dev_err(ctrl->dev, "Invalid sys bus ID %u", firewall_id); in stm32_etzpc_grant_access()
50 return -EINVAL; in stm32_etzpc_grant_access()
57 /* Verify peripheral is non-secure and attributed to cortex A7 */ in stm32_etzpc_grant_access()
58 sec_val = (readl(ctrl->mmio + reg_offset) >> offset) & ETZPC_PROT_MASK; in stm32_etzpc_grant_access()
60 dev_dbg(ctrl->dev, "Invalid bus configuration: reg_offset %#x, value %d\n", in stm32_etzpc_grant_access()
62 return -EACCES; in stm32_etzpc_grant_access()
76 struct device_node *np = pdev->dev.of_node; in stm32_etzpc_probe()
82 etzpc_controller = devm_kzalloc(&pdev->dev, sizeof(*etzpc_controller), GFP_KERNEL); in stm32_etzpc_probe()
84 return -ENOMEM; in stm32_etzpc_probe()
90 etzpc_controller->dev = &pdev->dev; in stm32_etzpc_probe()
91 etzpc_controller->mmio = mmio; in stm32_etzpc_probe()
92 etzpc_controller->name = dev_driver_string(etzpc_controller->dev); in stm32_etzpc_probe()
93 etzpc_controller->type = STM32_PERIPHERAL_FIREWALL | STM32_MEMORY_FIREWALL; in stm32_etzpc_probe()
94 etzpc_controller->grant_access = stm32_etzpc_grant_access; in stm32_etzpc_probe()
95 etzpc_controller->release_access = stm32_etzpc_release_access; in stm32_etzpc_probe()
97 /* Get number of etzpc entries*/ in stm32_etzpc_probe()
99 readl(etzpc_controller->mmio + ETZPC_HWCFGR)); in stm32_etzpc_probe()
101 readl(etzpc_controller->mmio + ETZPC_HWCFGR)); in stm32_etzpc_probe()
102 etzpc_controller->max_entries = nb_per + nb_master; in stm32_etzpc_probe()
108 dev_err(etzpc_controller->dev, "Couldn't register as a firewall controller: %d", in stm32_etzpc_probe()
115 dev_err(etzpc_controller->dev, "Couldn't populate ETZPC bus: %d", in stm32_etzpc_probe()
121 return of_platform_populate(np, NULL, NULL, &pdev->dev); in stm32_etzpc_probe()
125 { .compatible = "st,stm32-etzpc" },
133 .name = "stm32-etzpc",
140 MODULE_DESCRIPTION("STMicroelectronics ETZPC driver");