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

Merge tag 'amlogic-drivers-for-v5.18' of...

Merge tag 'amlogic-drivers-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux into arm/drivers

Amlogic Drivers updates for v5.18:
- Add support for Amlogic S4 in meson-secure-pwrc power domain driver

* tag 'amlogic-drivers-for-v5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/amlogic/linux:
  soc: s4: Add support for power domains controller
  dt-bindings: power: add Amlogic s4 power domains bindings

Link: https://lore.kernel.org/r/c7471989-d929-c744-c0c3-c8e86eaaa225@baylibre.com


Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parents 608f7cf3 f2b03c10
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -12,13 +12,14 @@ maintainers:
  - Jianxin Pan <jianxin.pan@amlogic.com>

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

properties:
  compatible:
    enum:
      - amlogic,meson-a1-pwrc
      - amlogic,meson-s4-pwrc

  "#power-domain-cells":
    const: 1
+22 −0
Original line number Diff line number Diff line
@@ -11,6 +11,7 @@
#include <linux/platform_device.h>
#include <linux/pm_domain.h>
#include <dt-bindings/power/meson-a1-power.h>
#include <dt-bindings/power/meson-s4-power.h>
#include <linux/arm-smccc.h>
#include <linux/firmware/meson/meson_sm.h>
#include <linux/module.h>
@@ -119,6 +120,18 @@ static struct meson_secure_pwrc_domain_desc a1_pwrc_domains[] = {
	SEC_PD(RSA,	0),
};

static struct meson_secure_pwrc_domain_desc s4_pwrc_domains[] = {
	SEC_PD(S4_DOS_HEVC,	0),
	SEC_PD(S4_DOS_VDEC,	0),
	SEC_PD(S4_VPU_HDMI,	0),
	SEC_PD(S4_USB_COMB,	0),
	SEC_PD(S4_GE2D,		0),
	/* ETH is for ethernet online wakeup, and should be always on */
	SEC_PD(S4_ETH,		GENPD_FLAG_ALWAYS_ON),
	SEC_PD(S4_DEMOD,	0),
	SEC_PD(S4_AUDIO,	0),
};

static int meson_secure_pwrc_probe(struct platform_device *pdev)
{
	int i;
@@ -187,11 +200,20 @@ 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 meson_secure_s4_pwrc_data = {
	.domains = s4_pwrc_domains,
	.count = ARRAY_SIZE(s4_pwrc_domains),
};

static const struct of_device_id meson_secure_pwrc_match_table[] = {
	{
		.compatible = "amlogic,meson-a1-pwrc",
		.data = &meson_secure_a1_pwrc_data,
	},
	{
		.compatible = "amlogic,meson-s4-pwrc",
		.data = &meson_secure_s4_pwrc_data,
	},
	{ /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, meson_secure_pwrc_match_table);
+19 −0
Original line number Diff line number Diff line
/* SPDX-License-Identifier: (GPL-2.0+ or MIT) */
/*
 * Copyright (c) 2021 Amlogic, Inc.
 * Author: Shunzhou Jiang <shunzhou.jiang@amlogic.com>
 */

#ifndef _DT_BINDINGS_MESON_S4_POWER_H
#define _DT_BINDINGS_MESON_S4_POWER_H

#define PWRC_S4_DOS_HEVC_ID	0
#define PWRC_S4_DOS_VDEC_ID	1
#define PWRC_S4_VPU_HDMI_ID	2
#define PWRC_S4_USB_COMB_ID	3
#define PWRC_S4_GE2D_ID		4
#define PWRC_S4_ETH_ID		5
#define PWRC_S4_DEMOD_ID	6
#define PWRC_S4_AUDIO_ID	7

#endif