Unverified Commit f1c047c2 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

Merge tag 'amlogic-drivers-for-v6.6' of...

Merge tag 'amlogic-drivers-for-v6.6' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into soc/drivers

Amlogic drivers changes for v6.6:
- Add C3 Power Domains
- Explicitly include correct DT includes in Amlogic SoC drivers
- fix to avoid potential NULL pointer dereference in meson_sm
- Merge of genpd-v6.5-rc1-1 to move genpd amlogic drivers

* tag 'amlogic-drivers-for-v6.6' of https://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux:
  firmware: meson_sm: fix to avoid potential NULL pointer dereference
  soc: amlogic: Explicitly include correct DT includes
  soc: c3: Add support for power domains controller
  dt-bindings: power: add Amlogic C3 power domains
  soc: amlogic: use name instead of index as criterion

Link: https://lore.kernel.org/r/77e328b5-0d47-36e8-f62d-c745df06fb87@linaro.org


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 800b4320 f2ed1656
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -12,7 +12,7 @@ maintainers:
  - Jianxin Pan <jianxin.pan@amlogic.com>

description: |+
  Secure Power Domains used in Meson A1/C1/S4 SoCs, and should be the child node
  Secure Power Domains used in Meson A1/C1/S4 & C3 SoCs, and should be the child node
  of secure-monitor.

properties:
@@ -20,6 +20,7 @@ properties:
    enum:
      - amlogic,meson-a1-pwrc
      - amlogic,meson-s4-pwrc
      - amlogic,c3-pwrc

  "#power-domain-cells":
    const: 1
+2 −0
Original line number Diff line number Diff line
@@ -292,6 +292,8 @@ static int __init meson_sm_probe(struct platform_device *pdev)
		return -ENOMEM;

	chip = of_match_device(meson_sm_ids, dev)->data;
	if (!chip)
		return -EINVAL;

	if (chip->cmd_shmem_in_base) {
		fw->sm_shmem_in_base = meson_sm_map_shmem(chip->cmd_shmem_in_base,
+1 −2
Original line number Diff line number Diff line
@@ -4,13 +4,12 @@
 * Author: Neil Armstrong <narmstrong@baylibre.com>
 */

#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
#include <linux/bitfield.h>
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/reset-controller.h>
#include <linux/reset.h>
#include <linux/clk.h>
+1 −2
Original line number Diff line number Diff line
@@ -5,13 +5,12 @@
 * SPDX-License-Identifier: GPL-2.0+
 */

#include <linux/of_address.h>
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
#include <linux/bitfield.h>
#include <linux/regmap.h>
#include <linux/mfd/syscon.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/reset.h>
#include <linux/clk.h>
#include <linux/module.h>
+28 −2
Original line number Diff line number Diff line
@@ -7,10 +7,11 @@
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/io.h>
#include <linux/of_device.h>
#include <linux/of.h>
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
#include <dt-bindings/power/meson-a1-power.h>
#include <dt-bindings/power/amlogic,c3-pwrc.h>
#include <dt-bindings/power/meson-s4-power.h>
#include <linux/arm-smccc.h>
#include <linux/firmware/meson/meson_sm.h>
@@ -120,6 +121,22 @@ static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
	SEC_PD(RSA,	0),
};

static struct meson_secure_pwrc_domain_desc c3_pwrc_domains[] = {
	SEC_PD(C3_NNA,	0),
	SEC_PD(C3_AUDIO,	GENPD_FLAG_ALWAYS_ON),
	SEC_PD(C3_SDIOA,	GENPD_FLAG_ALWAYS_ON),
	SEC_PD(C3_EMMC,	GENPD_FLAG_ALWAYS_ON),
	SEC_PD(C3_USB_COMB, GENPD_FLAG_ALWAYS_ON),
	SEC_PD(C3_SDCARD,	GENPD_FLAG_ALWAYS_ON),
	SEC_PD(C3_ETH,	GENPD_FLAG_ALWAYS_ON),
	SEC_PD(C3_GE2D,	GENPD_FLAG_ALWAYS_ON),
	SEC_PD(C3_CVE,	GENPD_FLAG_ALWAYS_ON),
	SEC_PD(C3_GDC_WRAP,	GENPD_FLAG_ALWAYS_ON),
	SEC_PD(C3_ISP_TOP,		GENPD_FLAG_ALWAYS_ON),
	SEC_PD(C3_MIPI_ISP_WRAP, GENPD_FLAG_ALWAYS_ON),
	SEC_PD(C3_VCODEC,	0),
};

static struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = {
	SEC_PD(S4_DOS_HEVC,	0),
	SEC_PD(S4_DOS_VDEC,	0),
@@ -179,7 +196,7 @@ static int meson_secure_pwrc_probe(struct platform_device *pdev)
	for (i = 0 ; i < match->count ; ++i) {
		struct meson_secure_pwrc_domain *dom = &pwrc->domains[i];

		if (!match->domains[i].index)
		if (!match->domains[i].name)
			continue;

		dom->pwrc = pwrc;
@@ -202,6 +219,11 @@ static struct meson_secure_pwrc_domain_data meson_secure_a1_pwrc_data = {
	.count = ARRAY_SIZE(a1_pwrc_domains),
};

static struct meson_secure_pwrc_domain_data amlogic_secure_c3_pwrc_data = {
	.domains = c3_pwrc_domains,
	.count = ARRAY_SIZE(c3_pwrc_domains),
};

static struct meson_secure_pwrc_domain_data meson_secure_s4_pwrc_data = {
	.domains = s4_pwrc_domains,
	.count = ARRAY_SIZE(s4_pwrc_domains),
@@ -212,6 +234,10 @@ static const struct of_device_id meson_secure_pwrc_match_table[] = {
		.compatible = "amlogic,meson-a1-pwrc",
		.data = &meson_secure_a1_pwrc_data,
	},
	{
		.compatible = "amlogic,c3-pwrc",
		.data = &amlogic_secure_c3_pwrc_data,
	},
	{
		.compatible = "amlogic,meson-s4-pwrc",
		.data = &meson_secure_s4_pwrc_data,
Loading