Lines Matching +full:baikal +full:- +full:t1

1 // SPDX-License-Identifier: GPL-2.0-only
3 * Copyright (C) 2020 BAIKAL ELECTRONICS, JSC
8 * Baikal-T1 CM2 L2-cache Control Block driver.
38 * struct l2_ctl - Baikal-T1 L2 Control block private data.
40 * @sys_regs: Baikal-T1 System Controller registers map.
49 * enum l2_ctl_stall - Baikal-T1 L2-cache-RAM stall identifier.
50 * @L2_WSSTALL: Way-select latency.
61 * struct l2_ctl_device_attribute - Baikal-T1 L2-cache device attribute.
63 * @id: L2-cache stall field identifier.
82 ret = regmap_read(l2->sys_regs, L2_CTL_REG, &data); in l2_ctl_get_latency()
97 return -EINVAL; in l2_ctl_get_latency()
124 return -EINVAL; in l2_ctl_set_latency()
130 ret = regmap_update_bits(l2->sys_regs, L2_CTL_REG, mask, data); in l2_ctl_set_latency()
134 return regmap_read_poll_timeout(l2->sys_regs, L2_CTL_REG, data, in l2_ctl_set_latency()
143 struct platform_device *pdev = to_platform_device(l2->dev); in l2_ctl_clear_data()
150 struct device *dev = &pdev->dev; in l2_ctl_create_data()
156 return ERR_PTR(-ENOMEM); in l2_ctl_create_data()
164 l2->dev = dev; in l2_ctl_create_data()
172 l2->sys_regs = syscon_node_to_regmap(l2->dev->of_node->parent); in l2_ctl_find_sys_regs()
173 if (IS_ERR(l2->sys_regs)) { in l2_ctl_find_sys_regs()
174 dev_err(l2->dev, "Couldn't get L2 CTL register map\n"); in l2_ctl_find_sys_regs()
175 return PTR_ERR(l2->sys_regs); in l2_ctl_find_sys_regs()
187 if (!of_property_read_u32(l2->dev->of_node, propname, &data)) { in l2_ctl_of_parse_property()
190 dev_err(l2->dev, "Invalid value of '%s'\n", propname); in l2_ctl_of_parse_property()
200 ret = l2_ctl_of_parse_property(l2, L2_WS_STALL, "baikal,l2-ws-latency"); in l2_ctl_of_parse()
204 ret = l2_ctl_of_parse_property(l2, L2_TAG_STALL, "baikal,l2-tag-latency"); in l2_ctl_of_parse()
209 "baikal,l2-data-latency"); in l2_ctl_of_parse()
221 ret = l2_ctl_get_latency(l2, devattr->id, &data); in l2_ctl_latency_show()
238 return -EINVAL; in l2_ctl_latency_store()
240 ret = l2_ctl_set_latency(l2, devattr->id, data); in l2_ctl_latency_store()
263 device_remove_groups(l2->dev, l2_ctl_sysfs_groups); in l2_ctl_remove_sysfs()
270 ret = device_add_groups(l2->dev, l2_ctl_sysfs_groups); in l2_ctl_init_sysfs()
272 dev_err(l2->dev, "Failed to create L2 CTL sysfs nodes\n"); in l2_ctl_init_sysfs()
276 ret = devm_add_action_or_reset(l2->dev, l2_ctl_remove_sysfs, l2); in l2_ctl_init_sysfs()
278 dev_err(l2->dev, "Can't add L2 CTL sysfs remove action\n"); in l2_ctl_init_sysfs()
308 { .compatible = "baikal,bt1-l2-ctl" },
316 .name = "bt1-l2-ctl",
323 MODULE_DESCRIPTION("Baikal-T1 L2-cache driver");