devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
To: amit daniel kachhap
	<amit.daniel-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
Cc: Zhang Rui <rui.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>,
	Eduardo Valentin <eduardo.valentin-l0cyMroinI0@public.gmane.org>,
	"Rafael J. Wysocki" <rjw-KKrjLPT3xs0@public.gmane.org>,
	Linux PM list <linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Jonghwa Lee
	<jonghwa3.lee-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Lukasz Majewski
	<l.majewski-AM3owJQeAb5mR6Xm/wNWPw@public.gmane.org>,
	linux-kernel
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Bartlomiej Zolnierkiewicz
	<b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	Myungjoo Ham
	<myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	"linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412
Date: Tue, 01 Oct 2013 08:55:02 +0200	[thread overview]
Message-ID: <20131001085502.187f54ab@amdc308.digital.local> (raw)
In-Reply-To: <CADGdYn6a1jSR17v0N6kVFZFsn71FUbXJHjeSya-xy_wX9GtYpg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi Amit,

> Hi,
> 
> On Tue, Sep 24, 2013 at 1:38 PM, Lukasz Majewski
> <l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
> > The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("thermal:
> > exynos: Add missing definations and code cleanup") has removed
> > setting of test MUX address value at TMU configuration setting.
> >
> > This field is not present on Exynos4210 and Exynos5 SoCs. However
> > on Exynos4412 SoC it is required to set this field after reset
> > because without it TMU shows maximal available temperature, which
> > causes immediate platform shutdown.
> Right In 5250 this field is not defined so didn't catch this. The
> changes looks fine but I have a minor comment that if this field is
> defined in 4412 in detail then you can add a field entry in
> exynos_tmu_registers with proper name and populate this field. 

It seems, that only at Exynos4412 (and Exynos4212) this field is valid.
When I extent exynos_tmu_registers structure, then all other Samsung
SoCs will be aware of it.
Define with explicit EXYNOS4412 seems more readable. 


Also at exynos_tmu_control() function we use constructs like:
data->base + EXYNOS_TMU_REG_CONTROL, not data->base + regs->tmu_ctrl.

> The
> good thing is that in 5250 also this field is reserved and the default
> value is 0x6 so same TMU_DATA can be used for 5250 and 4412.

I'm not keen to this kind of hacks. This field is only valid on
Exynos4x12. And for Exynos5250 is reserved, which means that we shall
not touch it.

> The main
> idea of this suggestion is to reduce the soc checks in the driver.

Correct me if I'm wrong, but this MUX_ADDR initialization is performed
at exynos_tmu_control() which is called at probe and thermal power
management functions. Therefore, it seems that checking if SoC ==
Exynos4412 there is not an overkill.

If you don't mind I would leave those patches as they are and kindly
ask thermal maintainers for pulling them to v3.12.

> 
> Thanks,
> Amit Daniel
> >
> > Signed-off-by: Lukasz Majewski <l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> > Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> > Reviewed-by: Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> > ---
> >  drivers/thermal/samsung/exynos_tmu.c      |    3 +++
> >  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
> >  2 files changed, 7 insertions(+)
> >
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c
> > b/drivers/thermal/samsung/exynos_tmu.c index a858cc4..21b89e4 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -317,6 +317,9 @@ static void exynos_tmu_control(struct
> > platform_device *pdev, bool on)
> >
> >         con = readl(data->base + reg->tmu_ctrl);
> >
> > +       if (pdata->type == SOC_ARCH_EXYNOS4412)
> > +               con |= (EXYNOS4412_MUX_ADDR_VALUE <<
> > EXYNOS4412_MUX_ADDR_SHIFT); +
> >         if (pdata->reference_voltage) {
> >                 con &= ~(reg->buf_vref_sel_mask <<
> > reg->buf_vref_sel_shift); con |= pdata->reference_voltage <<
> > reg->buf_vref_sel_shift; diff --git
> > a/drivers/thermal/samsung/exynos_tmu_data.h
> > b/drivers/thermal/samsung/exynos_tmu_data.h index b130b1e..a1ea19d
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.h +++
> > b/drivers/thermal/samsung/exynos_tmu_data.h @@ -95,6 +95,10 @@
> >
> >  #define EXYNOS_MAX_TRIGGER_PER_REG     4
> >
> > +/* Exynos4412 specific */
> > +#define EXYNOS4412_MUX_ADDR_VALUE          6
> > +#define EXYNOS4412_MUX_ADDR_SHIFT          20
> > +
> >  /*exynos5440 specific registers*/
> >  #define EXYNOS5440_TMU_S0_7_TRIM               0x000
> >  #define EXYNOS5440_TMU_S0_7_CTRL               0x020
> > --
> > 1.7.10.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-pm"
> > in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> On Tue, Sep 24, 2013 at 1:38 PM, Lukasz Majewski
> <l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org> wrote:
> > The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("thermal:
> > exynos: Add missing definations and code cleanup") has removed
> > setting of test MUX address value at TMU configuration setting.
> >
> > This field is not present on Exynos4210 and Exynos5 SoCs. However
> > on Exynos4412 SoC it is required to set this field after reset
> > because without it TMU shows maximal available temperature, which
> > causes immediate platform shutdown.
> >
> > Signed-off-by: Lukasz Majewski <l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> > Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> > Reviewed-by: Tomasz Figa <t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
> > ---
> >  drivers/thermal/samsung/exynos_tmu.c      |    3 +++
> >  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
> >  2 files changed, 7 insertions(+)
> >
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c
> > b/drivers/thermal/samsung/exynos_tmu.c index a858cc4..21b89e4 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -317,6 +317,9 @@ static void exynos_tmu_control(struct
> > platform_device *pdev, bool on)
> >
> >         con = readl(data->base + reg->tmu_ctrl);
> >
> > +       if (pdata->type == SOC_ARCH_EXYNOS4412)
> > +               con |= (EXYNOS4412_MUX_ADDR_VALUE <<
> > EXYNOS4412_MUX_ADDR_SHIFT); +
> >         if (pdata->reference_voltage) {
> >                 con &= ~(reg->buf_vref_sel_mask <<
> > reg->buf_vref_sel_shift); con |= pdata->reference_voltage <<
> > reg->buf_vref_sel_shift; diff --git
> > a/drivers/thermal/samsung/exynos_tmu_data.h
> > b/drivers/thermal/samsung/exynos_tmu_data.h index b130b1e..a1ea19d
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.h +++
> > b/drivers/thermal/samsung/exynos_tmu_data.h @@ -95,6 +95,10 @@
> >
> >  #define EXYNOS_MAX_TRIGGER_PER_REG     4
> >
> > +/* Exynos4412 specific */
> > +#define EXYNOS4412_MUX_ADDR_VALUE          6
> > +#define EXYNOS4412_MUX_ADDR_SHIFT          20
> > +
> >  /*exynos5440 specific registers*/
> >  #define EXYNOS5440_TMU_S0_7_TRIM               0x000
> >  #define EXYNOS5440_TMU_S0_7_CTRL               0x020
> > --
> > 1.7.10.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-pm"
> > in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2013-10-01  6:55 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-24  8:08 [PATCH 0/6] thermal: exynos: Fixes for v3.12 Lukasz Majewski
2013-09-24  8:08 ` [PATCH 1/6] thermal: exynos: fix: Return from exynos_report_trigger() when therm_dev is NULL Lukasz Majewski
2013-09-30 10:52   ` amit daniel kachhap
2013-10-03 21:40   ` Eduardo Valentin
     [not found]     ` <524DE45E.1060606-l0cyMroinI0@public.gmane.org>
2013-10-04  9:56       ` Lukasz Majewski
2013-09-24  8:08 ` [PATCH 2/6] thermal: exynos: Provide separate TMU data for Exynos4412 Lukasz Majewski
2013-09-30 11:43   ` amit daniel kachhap
2013-10-03 22:01   ` Eduardo Valentin
2013-10-04 10:04     ` Lukasz Majewski
2013-09-24  8:08 ` [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412 Lukasz Majewski
2013-09-30 11:59   ` amit daniel kachhap
     [not found]     ` <CADGdYn6a1jSR17v0N6kVFZFsn71FUbXJHjeSya-xy_wX9GtYpg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-10-01  6:55       ` Lukasz Majewski [this message]
     [not found]   ` <1380010102-25817-4-git-send-email-l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-10-03 22:05     ` Eduardo Valentin
2013-10-04 10:20       ` Lukasz Majewski
2013-09-24  8:08 ` [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250 Lukasz Majewski
     [not found]   ` <1380010102-25817-5-git-send-email-l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-09-30 12:02     ` amit daniel kachhap
2013-10-03 22:08   ` Eduardo Valentin
2013-10-04 10:13     ` Bartlomiej Zolnierkiewicz
2013-10-04 10:23     ` Lukasz Majewski
2013-10-04 10:47       ` Bartlomiej Zolnierkiewicz
2013-10-04 15:07         ` Eduardo Valentin
2013-09-24  8:08 ` [PATCH 5/6] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12 Lukasz Majewski
2013-09-24  8:08 ` [PATCH 6/6] ARM: dts: exynos4412-trats2: Enable TMU support at Trats2 Lukasz Majewski
2013-09-24  9:29 ` [PATCH 0/6] thermal: exynos: Fixes for v3.12 Tomasz Figa
2013-10-03 13:29 ` Lukasz Majewski
2013-10-09  6:29 ` [PATCH v2 0/5] " Lukasz Majewski
     [not found]   ` <1381300194-13134-1-git-send-email-l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-10-09  6:29     ` [PATCH v2 1/5] thermal: exynos: Remove check for thermal device pointer at exynos_report_trigger() Lukasz Majewski
2013-10-09  6:29     ` [PATCH v2 2/5] thermal: exynos: Provide separate TMU data for Exynos4412 Lukasz Majewski
2013-10-14 14:20       ` Eduardo Valentin
2013-10-14 14:52         ` Lukasz Majewski
2013-10-09  6:29   ` [PATCH v2 3/5] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412 Lukasz Majewski
2013-10-14 14:24     ` Eduardo Valentin
2013-10-14 15:00       ` Lukasz Majewski
2013-10-14 19:20         ` Eduardo Valentin
2013-10-09  6:29   ` [PATCH v2 4/5] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12 Lukasz Majewski
2013-10-15  6:27     ` Lukasz Majewski
2013-10-15 13:37       ` Eduardo Valentin
2013-11-27  7:11       ` Lukasz Majewski
2013-11-27 11:34         ` kgene
2013-11-27 12:39           ` Lukasz Majewski
2013-12-09  8:33           ` Lukasz Majewski
     [not found]     ` <1381300194-13134-5-git-send-email-l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-14 10:03       ` [RESEND PATCH 1/2] " Lukasz Majewski
     [not found]         ` <1415959405-14157-1-git-send-email-l.majewski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2014-11-14 10:03           ` [RESEND PATCH 2/2] ARM: dts: exynos4412-trats2: Enable TMU support at Trats2 Lukasz Majewski
2013-10-09  6:29   ` [PATCH v2 5/5] " Lukasz Majewski
2013-10-15  6:29     ` Lukasz Majewski
2013-11-27  7:12       ` Lukasz Majewski
2013-11-27 11:36         ` kgene
2014-11-14  9:26           ` Lukasz Majewski
2013-10-14  5:46   ` [PATCH v2 0/5] thermal: exynos: Fixes for v3.12 Lukasz Majewski
2013-10-14  5:52     ` Zhang, Rui
     [not found]       ` <744357E9AAD1214791ACBA4B0B90926301190077-0J0gbvR4kThpB2pF5aRoyrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2013-10-14 19:13         ` Eduardo Valentin
2013-10-14 19:22           ` Eduardo Valentin
2013-10-15  6:23             ` Lukasz Majewski

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=20131001085502.187f54ab@amdc308.digital.local \
    --to=l.majewski-sze3o3uu22jbdgjk7y7tuq@public.gmane.org \
    --cc=amit.daniel-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=b.zolnierkie-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=eduardo.valentin-l0cyMroinI0@public.gmane.org \
    --cc=jonghwa3.lee-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=l.majewski-AM3owJQeAb5mR6Xm/wNWPw@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=myungjoo.ham-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
    --cc=rjw-KKrjLPT3xs0@public.gmane.org \
    --cc=rui.zhang-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=t.figa-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.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).