Skip to content

Commit 32bcbf8

Browse files
committed
Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC driver updates from Olof Johansson: "This contains platform-related driver updates for ARM and ARM64. Highlights: - ARM SCMI (System Control & Management Interface) driver cleanups - Hisilicon support for LPC bus w/ ACPI - Reset driver updates for several platforms: Uniphier, - Rockchip power domain bindings and hardware descriptions for several SoCs. - Tegra memory controller reset improvements" * tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (59 commits) ARM: tegra: fix compile-testing PCI host driver soc: rockchip: power-domain: add power domain support for px30 dt-bindings: power: add binding for px30 power domains dt-bindings: power: add PX30 SoCs header for power-domain soc: rockchip: power-domain: add power domain support for rk3228 dt-bindings: power: add binding for rk3228 power domains dt-bindings: power: add RK3228 SoCs header for power-domain soc: rockchip: power-domain: add power domain support for rk3128 dt-bindings: power: add binding for rk3128 power domains dt-bindings: power: add RK3128 SoCs header for power-domain soc: rockchip: power-domain: add power domain support for rk3036 dt-bindings: power: add binding for rk3036 power domains dt-bindings: power: add RK3036 SoCs header for power-domain dt-bindings: memory: tegra: Remove Tegra114 SATA and AFI reset definitions memory: tegra: Remove Tegra114 SATA and AFI reset definitions memory: tegra: Register SMMU after MC driver became ready soc: mediatek: remove unneeded semicolon soc: mediatek: add a fixed wait for SRAM stable soc: mediatek: introduce a CAPS flag for scp_domain_data soc: mediatek: reuse regmap_read_poll_timeout helpers ...
2 parents 721afaa + 3256135 commit 32bcbf8

54 files changed

Lines changed: 1677 additions & 916 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/devicetree/bindings/power/pd-samsung.txt‎

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,13 @@ Required Properties:
1515
Optional Properties:
1616
- label: Human readable string with domain name. Will be visible in userspace
1717
to let user to distinguish between multiple domains in SoC.
18-
- clocks: List of clock handles. The parent clocks of the input clocks to the
19-
devices in this power domain are set to oscclk before power gating
20-
and restored back after powering on a domain. This is required for
21-
all domains which are powered on and off and not required for unused
22-
domains.
23-
- clock-names: The following clocks can be specified:
24-
- oscclk: Oscillator clock.
25-
- clkN: Input clocks to the devices in this power domain. These clocks
26-
will be reparented to oscclk before switching power domain off.
27-
Their original parent will be brought back after turning on
28-
the domain. Maximum of 4 clocks (N = 0 to 3) are supported.
29-
- asbN: Clocks required by asynchronous bridges (ASB) present in
30-
the power domain. These clock should be enabled during power
31-
domain on/off operations.
3218
- power-domains: phandle pointing to the parent power domain, for more details
3319
see Documentation/devicetree/bindings/power/power_domain.txt
3420

21+
Deprecated Properties:
22+
- clocks
23+
- clock-names
24+
3525
Node of a device using power domains must have a power-domains property
3626
defined with a phandle to respective power domain.
3727

@@ -47,8 +37,6 @@ Example:
4737
mfc_pd: power-domain@10044060 {
4838
compatible = "samsung,exynos4210-pd";
4939
reg = <0x10044060 0x20>;
50-
clocks = <&clock CLK_FIN_PLL>, <&clock CLK_MOUT_USER_ACLK333>;
51-
clock-names = "oscclk", "clk0";
5240
#power-domain-cells = <0>;
5341
label = "MFC";
5442
};

‎Documentation/devicetree/bindings/soc/rockchip/power_domain.txt‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ powered up/down by software based on different application scenes to save power.
55

66
Required properties for power domain controller:
77
- compatible: Should be one of the following.
8+
"rockchip,px30-power-controller" - for PX30 SoCs.
9+
"rockchip,rk3036-power-controller" - for RK3036 SoCs.
10+
"rockchip,rk3128-power-controller" - for RK3128 SoCs.
11+
"rockchip,rk3228-power-controller" - for RK3228 SoCs.
812
"rockchip,rk3288-power-controller" - for RK3288 SoCs.
913
"rockchip,rk3328-power-controller" - for RK3328 SoCs.
1014
"rockchip,rk3366-power-controller" - for RK3366 SoCs.
@@ -17,6 +21,10 @@ Required properties for power domain controller:
1721

1822
Required properties for power domain sub nodes:
1923
- reg: index of the power domain, should use macros in:
24+
"include/dt-bindings/power/px30-power.h" - for PX30 type power domain.
25+
"include/dt-bindings/power/rk3036-power.h" - for RK3036 type power domain.
26+
"include/dt-bindings/power/rk3128-power.h" - for RK3128 type power domain.
27+
"include/dt-bindings/power/rk3228-power.h" - for RK3228 type power domain.
2028
"include/dt-bindings/power/rk3288-power.h" - for RK3288 type power domain.
2129
"include/dt-bindings/power/rk3328-power.h" - for RK3328 type power domain.
2230
"include/dt-bindings/power/rk3366-power.h" - for RK3366 type power domain.
@@ -93,6 +101,10 @@ Node of a device using power domains must have a power-domains property,
93101
containing a phandle to the power device node and an index specifying which
94102
power domain to use.
95103
The index should use macros in:
104+
"include/dt-bindings/power/px30-power.h" - for px30 type power domain.
105+
"include/dt-bindings/power/rk3036-power.h" - for rk3036 type power domain.
106+
"include/dt-bindings/power/rk3128-power.h" - for rk3128 type power domain.
107+
"include/dt-bindings/power/rk3128-power.h" - for rk3228 type power domain.
96108
"include/dt-bindings/power/rk3288-power.h" - for rk3288 type power domain.
97109
"include/dt-bindings/power/rk3328-power.h" - for rk3328 type power domain.
98110
"include/dt-bindings/power/rk3366-power.h" - for rk3366 type power domain.

‎drivers/bus/Kconfig‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ config HISILICON_LPC
3333
bool "Support for ISA I/O space on HiSilicon Hip06/7"
3434
depends on ARM64 && (ARCH_HISI || COMPILE_TEST)
3535
select INDIRECT_PIO
36-
select MFD_CORE if ACPI
3736
help
3837
Driver to enable I/O access to devices attached to the Low Pin
3938
Count bus on the HiSilicon Hip06/7 SoC.

‎drivers/bus/arm-cci.c‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -371,8 +371,6 @@ asmlinkage void __naked cci_enable_port_for_self(void)
371371
[sizeof_struct_cpu_port] "i" (sizeof(struct cpu_port)),
372372
[sizeof_struct_ace_port] "i" (sizeof(struct cci_ace_port)),
373373
[offsetof_port_phys] "i" (offsetof(struct cci_ace_port, phys)) );
374-
375-
unreachable();
376374
}
377375

378376
/**

‎drivers/bus/hisi_lpc.c‎

Lines changed: 97 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111
#include <linux/delay.h>
1212
#include <linux/io.h>
1313
#include <linux/logic_pio.h>
14-
#include <linux/mfd/core.h>
1514
#include <linux/module.h>
1615
#include <linux/of.h>
1716
#include <linux/of_address.h>
1817
#include <linux/of_platform.h>
1918
#include <linux/pci.h>
19+
#include <linux/serial_8250.h>
2020
#include <linux/slab.h>
2121

2222
#define DRV_NAME "hisi-lpc"
@@ -341,15 +341,6 @@ static const struct logic_pio_host_ops hisi_lpc_ops = {
341341
};
342342

343343
#ifdef CONFIG_ACPI
344-
#define MFD_CHILD_NAME_PREFIX DRV_NAME"-"
345-
#define MFD_CHILD_NAME_LEN (ACPI_ID_LEN + sizeof(MFD_CHILD_NAME_PREFIX) - 1)
346-
347-
struct hisi_lpc_mfd_cell {
348-
struct mfd_cell_acpi_match acpi_match;
349-
char name[MFD_CHILD_NAME_LEN];
350-
char pnpid[ACPI_ID_LEN];
351-
};
352-
353344
static int hisi_lpc_acpi_xlat_io_res(struct acpi_device *adev,
354345
struct acpi_device *host,
355346
struct resource *res)
@@ -368,7 +359,7 @@ static int hisi_lpc_acpi_xlat_io_res(struct acpi_device *adev,
368359
}
369360

370361
/*
371-
* hisi_lpc_acpi_set_io_res - set the resources for a child's MFD
362+
* hisi_lpc_acpi_set_io_res - set the resources for a child
372363
* @child: the device node to be updated the I/O resource
373364
* @hostdev: the device node associated with host controller
374365
* @res: double pointer to be set to the address of translated resources
@@ -452,78 +443,122 @@ static int hisi_lpc_acpi_set_io_res(struct device *child,
452443
return 0;
453444
}
454445

446+
static int hisi_lpc_acpi_remove_subdev(struct device *dev, void *unused)
447+
{
448+
platform_device_unregister(to_platform_device(dev));
449+
return 0;
450+
}
451+
452+
struct hisi_lpc_acpi_cell {
453+
const char *hid;
454+
const char *name;
455+
void *pdata;
456+
size_t pdata_size;
457+
};
458+
455459
/*
456460
* hisi_lpc_acpi_probe - probe children for ACPI FW
457461
* @hostdev: LPC host device pointer
458462
*
459463
* Returns 0 when successful, and a negative value for failure.
460464
*
461-
* Scan all child devices and create a per-device MFD with
462-
* logical PIO translated IO resources.
465+
* Create a platform device per child, fixing up the resources
466+
* from bus addresses to Logical PIO addresses.
467+
*
463468
*/
464469
static int hisi_lpc_acpi_probe(struct device *hostdev)
465470
{
466471
struct acpi_device *adev = ACPI_COMPANION(hostdev);
467-
struct hisi_lpc_mfd_cell *hisi_lpc_mfd_cells;
468-
struct mfd_cell *mfd_cells;
469472
struct acpi_device *child;
470-
int size, ret, count = 0, cell_num = 0;
471-
472-
list_for_each_entry(child, &adev->children, node)
473-
cell_num++;
474-
475-
/* allocate the mfd cell and companion ACPI info, one per child */
476-
size = sizeof(*mfd_cells) + sizeof(*hisi_lpc_mfd_cells);
477-
mfd_cells = devm_kcalloc(hostdev, cell_num, size, GFP_KERNEL);
478-
if (!mfd_cells)
479-
return -ENOMEM;
473+
int ret;
480474

481-
hisi_lpc_mfd_cells = (struct hisi_lpc_mfd_cell *)&mfd_cells[cell_num];
482475
/* Only consider the children of the host */
483476
list_for_each_entry(child, &adev->children, node) {
484-
struct mfd_cell *mfd_cell = &mfd_cells[count];
485-
struct hisi_lpc_mfd_cell *hisi_lpc_mfd_cell =
486-
&hisi_lpc_mfd_cells[count];
487-
struct mfd_cell_acpi_match *acpi_match =
488-
&hisi_lpc_mfd_cell->acpi_match;
489-
char *name = hisi_lpc_mfd_cell[count].name;
490-
char *pnpid = hisi_lpc_mfd_cell[count].pnpid;
491-
struct mfd_cell_acpi_match match = {
492-
.pnpid = pnpid,
477+
const char *hid = acpi_device_hid(child);
478+
const struct hisi_lpc_acpi_cell *cell;
479+
struct platform_device *pdev;
480+
const struct resource *res;
481+
bool found = false;
482+
int num_res;
483+
484+
ret = hisi_lpc_acpi_set_io_res(&child->dev, &adev->dev, &res,
485+
&num_res);
486+
if (ret) {
487+
dev_warn(hostdev, "set resource fail (%d)\n", ret);
488+
goto fail;
489+
}
490+
491+
cell = (struct hisi_lpc_acpi_cell []){
492+
/* ipmi */
493+
{
494+
.hid = "IPI0001",
495+
.name = "hisi-lpc-ipmi",
496+
},
497+
/* 8250-compatible uart */
498+
{
499+
.hid = "HISI1031",
500+
.name = "serial8250",
501+
.pdata = (struct plat_serial8250_port []) {
502+
{
503+
.iobase = res->start,
504+
.uartclk = 1843200,
505+
.iotype = UPIO_PORT,
506+
.flags = UPF_BOOT_AUTOCONF,
507+
},
508+
{}
509+
},
510+
.pdata_size = 2 *
511+
sizeof(struct plat_serial8250_port),
512+
},
513+
{}
493514
};
494515

495-
/*
496-
* For any instances of this host controller (Hip06 and Hip07
497-
* are the only chipsets), we would not have multiple slaves
498-
* with the same HID. And in any system we would have just one
499-
* controller active. So don't worrry about MFD name clashes.
500-
*/
501-
snprintf(name, MFD_CHILD_NAME_LEN, MFD_CHILD_NAME_PREFIX"%s",
502-
acpi_device_hid(child));
503-
snprintf(pnpid, ACPI_ID_LEN, "%s", acpi_device_hid(child));
504-
505-
memcpy(acpi_match, &match, sizeof(*acpi_match));
506-
mfd_cell->name = name;
507-
mfd_cell->acpi_match = acpi_match;
508-
509-
ret = hisi_lpc_acpi_set_io_res(&child->dev, &adev->dev,
510-
&mfd_cell->resources,
511-
&mfd_cell->num_resources);
512-
if (ret) {
513-
dev_warn(&child->dev, "set resource fail (%d)\n", ret);
514-
return ret;
516+
for (; cell && cell->name; cell++) {
517+
if (!strcmp(cell->hid, hid)) {
518+
found = true;
519+
break;
520+
}
515521
}
516-
count++;
517-
}
518522

519-
ret = mfd_add_devices(hostdev, PLATFORM_DEVID_NONE,
520-
mfd_cells, cell_num, NULL, 0, NULL);
521-
if (ret) {
522-
dev_err(hostdev, "failed to add mfd cells (%d)\n", ret);
523-
return ret;
523+
if (!found) {
524+
dev_warn(hostdev,
525+
"could not find cell for child device (%s)\n",
526+
hid);
527+
ret = -ENODEV;
528+
goto fail;
529+
}
530+
531+
pdev = platform_device_alloc(cell->name, PLATFORM_DEVID_AUTO);
532+
if (!pdev) {
533+
ret = -ENOMEM;
534+
goto fail;
535+
}
536+
537+
pdev->dev.parent = hostdev;
538+
ACPI_COMPANION_SET(&pdev->dev, child);
539+
540+
ret = platform_device_add_resources(pdev, res, num_res);
541+
if (ret)
542+
goto fail;
543+
544+
ret = platform_device_add_data(pdev, cell->pdata,
545+
cell->pdata_size);
546+
if (ret)
547+
goto fail;
548+
549+
ret = platform_device_add(pdev);
550+
if (ret)
551+
goto fail;
552+
553+
acpi_device_set_enumerated(child);
524554
}
525555

526556
return 0;
557+
558+
fail:
559+
device_for_each_child(hostdev, NULL,
560+
hisi_lpc_acpi_remove_subdev);
561+
return ret;
527562
}
528563

529564
static const struct acpi_device_id hisi_lpc_acpi_match[] = {

‎drivers/cpufreq/scmi-cpufreq.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
117117
return -ENODEV;
118118
}
119119

120-
ret = handle->perf_ops->add_opps_to_device(handle, cpu_dev);
120+
ret = handle->perf_ops->device_opps_add(handle, cpu_dev);
121121
if (ret) {
122122
dev_warn(cpu_dev, "failed to add opps to the device\n");
123123
return ret;
@@ -164,7 +164,7 @@ static int scmi_cpufreq_init(struct cpufreq_policy *policy)
164164
/* SCMI allows DVFS request for any domain from any CPU */
165165
policy->dvfs_possible_from_any_cpu = true;
166166

167-
latency = handle->perf_ops->get_transition_latency(handle, cpu_dev);
167+
latency = handle->perf_ops->transition_latency_get(handle, cpu_dev);
168168
if (!latency)
169169
latency = CPUFREQ_ETERNAL;
170170

0 commit comments

Comments
 (0)