linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: wni@nvidia.com (Wei Ni)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/3] ARM: tegra: Add thermal reset (thermtrip) support to PMC
Date: Wed, 13 Aug 2014 18:10:02 +0800	[thread overview]
Message-ID: <53EB397A.7000501@nvidia.com> (raw)
In-Reply-To: <1407226380-747-4-git-send-email-mperttunen@nvidia.com>

On 08/05/2014 04:13 PM, Mikko Perttunen wrote:
> This adds a device tree controlled option to enable PMC-based
> thermal reset in overheating situations. Thermtrip is supported on
> Tegra114 and Tegra124. The thermal reset only works when the thermal
> sensors are calibrated, so a soctherm driver is also required.
> 
> Signed-off-by: Mikko Perttunen <mperttunen@nvidia.com>
> ---
>  drivers/soc/tegra/pmc.c | 348 ++++++++++++++++++++++++++++++------------------
>  1 file changed, 216 insertions(+), 132 deletions(-)
> 
> diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c
> index a2c0ceb..2c617d7 100644
> --- a/drivers/soc/tegra/pmc.c
> +++ b/drivers/soc/tegra/pmc.c
> @@ -83,11 +83,28 @@
> 
>  #define GPU_RG_CNTRL                   0x2d4
> 
> +#define PMC_SENSOR_CTRL                        0x1b0
> +#define PMC_SENSOR_CTRL_SCRATCH_WRITE  (1 << 2)
> +#define PMC_SENSOR_CTRL_ENABLE_RST     (1 << 1)
> +
> +#define PMC_SCRATCH54                  0x258
> +#define PMC_SCRATCH54_DATA_SHIFT       8
> +#define PMC_SCRATCH54_ADDR_SHIFT       0
> +
> +#define PMC_SCRATCH55                  0x25c
> +#define PMC_SCRATCH55_RESET_TEGRA      (1 << 31)
> +#define PMC_SCRATCH55_CNTRL_ID_SHIFT   27
> +#define PMC_SCRATCH55_PINMUX_SHIFT     24
> +#define PMC_SCRATCH55_16BITOP          (1 << 15)
> +#define PMC_SCRATCH55_CHECKSUM_SHIFT   16
> +#define PMC_SCRATCH55_I2CSLV1_SHIFT    0
> +
>  struct tegra_pmc_soc {
>         unsigned int num_powergates;
>         const char *const *powergates;
>         unsigned int num_cpu_powergates;
>         const u8 *cpu_powergates;
> +       bool has_thermal_reset;

According to the DRM, the scratch54/55 is used for TSENSE_RESET, so I
prefer to change the name to has_tsense_reset().

>  };
> 
>  /**
> @@ -606,6 +623,203 @@ void tegra_pmc_enter_suspend_mode(enum tegra_suspend_mode mode)
>  }

> +
> +void tegra_pmc_init_thermal_reset(struct device_node *np)

I prefer to change the name to tegra_pmc_init_tsense_reset().

> +{
> +       u32 pmu_i2c_addr, i2c_ctrl_id, reg_addr, reg_data, pinmux;
> +       bool pmu_16bit_ops;
> +       u32 val, checksum;
> +       const struct of_device_id *match = of_match_node(tegra_pmc_match, np);
> +       const struct tegra_pmc_soc *data = match->data;
> +

> --
> 1.8.1.5
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-tegra" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  parent reply	other threads:[~2014-08-13 10:10 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-05  8:12 [PATCH 0/3] Thermal reset support in PMC Mikko Perttunen
2014-08-05  8:12 ` [PATCH 1/3] of: Add descriptions of thermtrip properties to Tegra PMC bindings Mikko Perttunen
2014-08-13  7:35   ` Thierry Reding
2014-08-13  7:51     ` Mikko Perttunen
2014-08-13  8:01       ` Thierry Reding
2014-08-05  8:12 ` [PATCH 2/3] ARM: tegra: Add PMC thermtrip programming to Jetson TK1 device tree Mikko Perttunen
2014-08-13  7:37   ` Thierry Reding
2014-08-13  7:52     ` Mikko Perttunen
2014-08-13  8:03       ` Thierry Reding
2014-08-13  8:06         ` Mikko Perttunen
2014-08-05  8:13 ` [PATCH 3/3] ARM: tegra: Add thermal reset (thermtrip) support to PMC Mikko Perttunen
2014-08-13  7:53   ` Thierry Reding
2014-08-13  8:05     ` Mikko Perttunen
2014-08-13 10:10   ` Wei Ni [this message]
2014-08-13  8:07 ` [PATCH 0/3] Thermal reset support in PMC Thierry Reding
2014-08-13  8:12   ` Mikko Perttunen
2014-08-13  8:42     ` Mikko Perttunen
2014-08-13  8:57       ` Thierry Reding
2014-08-13  9:52         ` Mikko Perttunen
2014-08-13 10:36           ` Thierry Reding
2014-08-13 10:41             ` Mikko Perttunen
2014-08-13 10:53               ` Thierry Reding
2014-08-13 10:59                 ` Mikko Perttunen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53EB397A.7000501@nvidia.com \
    --to=wni@nvidia.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).