public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Minkyu Kang <mk7.kang@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] drivers:power:exynos-tmu: add support for Exynos5260
Date: Thu, 05 Dec 2013 14:51:08 +0900	[thread overview]
Message-ID: <52A0144C.9090407@samsung.com> (raw)
In-Reply-To: <CAHfPSqAoijqq1A1EYLGOuTF6d+vnBUmSk-gmaikkdrJKtmjsdw@mail.gmail.com>

On 05/12/13 14:23, Naveen Krishna Ch wrote:
> Hello Minkyu,
> 
> On 3 December 2013 07:41, Minkyu Kang <mk7.kang@samsung.com> wrote:
>> Dear Naveen Krishna Chatradhi,
>>
>> On 26/11/13 20:56, Naveen Krishna Chatradhi wrote:
>>> This patch adds support for TMU on Exynos5260
>>> Register bit fields are little different from the previous
>>> versions.
>>>
>>> Change-Id: Ibe835abe9cb255d2f8375c8e9e32d32cff19c093
>>
>> please remove it.
>>
>>> Signed-off-by: Naveen Krishna Chatradhi <ch.naveen@samsung.com>
>>> ---
>>>  arch/arm/include/asm/arch-exynos/tmu.h |   11 +++++++++++
>>>  drivers/power/exynos-tmu.c             |   25 +++++++++++++++++++++++--
>>>  2 files changed, 34 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/arch/arm/include/asm/arch-exynos/tmu.h b/arch/arm/include/asm/arch-exynos/tmu.h
>>> index cad3569..19b8f62 100644
>>> --- a/arch/arm/include/asm/arch-exynos/tmu.h
>>> +++ b/arch/arm/include/asm/arch-exynos/tmu.h
>>> @@ -26,7 +26,11 @@ struct exynos5_tmu_reg {
>>>       u32 triminfo_control;
>>>       u32 rsvd5[2];
>>>       u32 tmu_control;
>>> +#ifdef CONFIG_EXYNOS5260
>>> +     u32 tmu_control1;
>>> +#else
>>>       u32 rsvd7;
>>> +#endif
>>>       u32 tmu_status;
>>>       u32 sampling_internal;
>>>       u32 counter_value0;
>>> @@ -41,10 +45,17 @@ struct exynos5_tmu_reg {
>>>       u32 past_temp7_4;
>>>       u32 past_temp11_8;
>>>       u32 past_temp15_12;
>>> +#ifdef CONFIG_EXYNOS5260
>>> +     u32 rsvd15[16];
>>> +#endif
>>>       u32 inten;
>>>       u32 intstat;
>>>       u32 intclear;
>>> +#ifdef CONFIG_EXYNOS5260
>>> +     u32 rsvd31[17];
>>> +#else
>>>       u32 rsvd15;
>>> +#endif
>>>       u32 emul_con;
>>>  };
>>>  #endif /* __ASM_ARCH_TMU_H */
>>> diff --git a/drivers/power/exynos-tmu.c b/drivers/power/exynos-tmu.c
>>> index 9a093a5..de3ff82 100644
>>> --- a/drivers/power/exynos-tmu.c
>>> +++ b/drivers/power/exynos-tmu.c
>>> @@ -31,7 +31,13 @@
>>>  #define INTEN_RISE0          1
>>>  #define INTEN_RISE1          (1 << 4)
>>>  #define INTEN_RISE2          (1 << 8)
>>> +
>>> +#ifdef CONFIG_EXYNOS5250
>>> +#define INTEN_FALL0          (1 << 12)
>>> +#else
>>>  #define INTEN_FALL0          (1 << 16)
>>> +#endif
>>> +
>>>  #define INTEN_FALL1          (1 << 20)
>>>  #define INTEN_FALL2          (1 << 24)
>>>
>>> @@ -43,9 +49,24 @@
>>>  #define INTCLEAR_FALL0               (1 << 16)
>>>  #define INTCLEAR_FALL1               (1 << 20)
>>>  #define INTCLEAR_FALL2               (1 << 24)
>>> +
>>> +#ifdef CONFIG_EXYNOS5260
>>> +#define INTEN_RISE3          (1 << 12)
>>> +#define INTEN_FALL3          (1 << 28)
>>> +#define INTCLEAR_RISE3               (1 << 12)
>>> +#define INTCLEAR_FALL3               (1 << 28)
>>> +#endif
>>> +
>>> +#if defined(INTCLEAR_RISE3) && defined(INTCLEAR_FALL3)
>>>  #define INTCLEARALL          (INTCLEAR_RISE0 | INTCLEAR_RISE1 | \
>>> -                              INTCLEAR_RISE2 | INTCLEAR_FALL0 | \
>>> -                              INTCLEAR_FALL1 | INTCLEAR_FALL2)
>>> +                             INTCLEAR_RISE2 | INTCLEAR_RISE3 | \
>>> +                             INTCLEAR_FALL0 | INTCLEAR_FALL1 | \
>>> +                             INTCLEAR_FALL2 | INTCLEAR_FALL3)
>>> +#else
>>> +#define INTCLEARALL          (INTCLEAR_RISE0 | INTCLEAR_RISE1 | \
>>> +                             INTCLEAR_RISE2 | INTCLEAR_FALL0 | \
>>> +                             INTCLEAR_FALL1 | INTCLEAR_FALL2)
>>> +#endif
>>>
>>>  /* Tmeperature threshold values for various thermal events */
>>>  struct temperature_params {
>>>
>>
>> I recommended that don't use ifdefs.
> Few register bits and offsets are different between Exynso5260 version
> of TMU and
> previous versions.
> 
> Heiko suggested using Ifdefs in I2C driver code if needed.
> http://www.mail-archive.com/u-boot at lists.denx.de/msg122689.html

On I2C driver side? I don't care.
On Exynos side? no.

> 
> I can use devicetree to pass on that information. But, changes are comparatively
> more than the actual differences.
> 
>> And if you want to support exynos5260 then please post full features and board file.
> Board file, DTSI files and other arch code for Exynos5260 is on its way.

please post them together.

>>
>> Thanks,
>> Minkyu Kang.
> 

Thanks,
Minkyu Kang.

      reply	other threads:[~2013-12-05  5:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26 11:56 [U-Boot] [PATCH] drivers:power:exynos-tmu: add support for Exynos5260 Naveen Krishna Chatradhi
2013-12-03  2:11 ` Minkyu Kang
2013-12-05  5:23   ` Naveen Krishna Ch
2013-12-05  5:51     ` Minkyu Kang [this message]

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=52A0144C.9090407@samsung.com \
    --to=mk7.kang@samsung.com \
    --cc=u-boot@lists.denx.de \
    /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