Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2012-01-06 Thread Chander Kashyap
Dear Wolfgang Denk,

On 5 January 2012 17:02, Wolfgang Denk w...@denx.de wrote:
 Dear Chander Kashyap,

 In message 
 canuqghhy8_6m1riva6rawry0pvrx5nnykxd_p+u340a0d4j...@mail.gmail.com you 
 wrote:

  No need to reuse the code, if SoCs are different.
  If need, please separate the functions.

 Yes, though SoC's are different, the functionality in clock.c is
 similar. The only difference is the clock name in the clock structure
 for Exynos4 and Exynos5 but the functionality is exactly same in
 clock.c. To accommodate this change in clock name #ifdef is used.

 If this is the only difference, then I suggest just to rename the
 field in thesta structure.  Although it makes sense to follow the names
 in the documentation, it is sometimes better tochose a more suitable
 name - a comment in the header file should be sufficient to explain
 the rename (and to provide an anchor in case something greps for the
 name as used in the docs).

 Maybe we can avoid both #ifdef's and code duplication this way?
Thanks for the suggestion.

 Best regards,

 Wolfgang Denk

 --
 DENX Software Engineering GmbH,     MD: Wolfgang Denk  Detlev Zundel
 HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
 Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
 What was sliced bread the greatest thing since?



-- 
with warm regards,
Chander Kashyap
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2012-01-06 Thread Chander Kashyap
Dear Minkyu Kang,

On 6 January 2012 07:10, Minkyu Kang proms...@gmail.com wrote:
 Dear Chander Kashyap,

 On 5 January 2012 19:31, Chander Kashyap chander.kash...@linaro.org wrote:
 Hi Minkyu Kang,

 On 5 January 2012 12:13, Minkyu Kang proms...@gmail.com wrote:
 Dear Chander Kashyap,

 On 27 December 2011 17:48, Chander Kashyap chander.kash...@linaro.org 
 wrote:
   Torsten Koschorrek koschor...@synertronixx.de
         scb9328         ARM920T (i.MXL)
  diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
  b/arch/arm/cpu/armv7/exynos/clock.c
  index b101f96..88e2fc0 100644
  --- a/arch/arm/cpu/armv7/exynos/clock.c
  +++ b/arch/arm/cpu/armv7/exynos/clock.c
  @@ -125,10 +125,14 @@ static unsigned long exynos_get_pwm_clk(void)
 
         if (s5p_get_cpu_rev() == 0) {
                 /*
  -                * CLK_SRC_PERIL0
  +                * CLK_SRC_{PERIL0 | PERIC0}
                  * PWM_SEL [27:24]
                  */
  +#ifdef CONFIG_EXYNOS5
  +               sel = readl(clk-src_peric0);
  +#else
                 sel = readl(clk-src_peril0);
  +#endif

 NAK.
 We don't allow to using ifdef for separating SoCs.
 Please refer s5pc1xx case for solve it.
 This comment apply to this patch globally.
 Please remove '#ifdef CONFIG_EXYNOS5'.

 I have tried to reuse the code. It is possible to remove
 #ifdef CONFIG_EXYNOS5' in clock.c with cpu_is_s5pcXXX check.
 Is it a acceptable solution? Or is it necessary to write SoC specific 
 function
 in clock.c as done in case of s5pc1xx/clock.c.

 Please Advice
 Removing CONFIG_EXYNOS5 and following s5pc1xx case will not allow to
 reuse the code in clock.c.
 What is the technical hindrance of not using ifdefs?

 No need to reuse the code, if SoCs are different.
 If need, please separate the functions.

 Yes, though SoC's are different, the functionality in clock.c is
 similar. The only difference is the clock name in the clock structure
 for Exynos4 and Exynos5 but the functionality is exactly same in
 clock.c. To accommodate this change in clock name #ifdef is used.

 Following is the function in clock .c which uses #ifdef to accommodate
 the different clock name in SoC's.

 static unsigned long exynos_get_pwm_clk(void)
 {
        struct exynos_clock *clk =
                (struct exynos_clock *)samsung_get_base_clock();
        unsigned long pclk, sclk;
        unsigned int sel;
        unsigned int ratio;

        if (s5p_get_cpu_rev() == 0) {
                /*
                 * CLK_SRC_{PERIL0 | PERIC0}
                 * PWM_SEL [27:24]
                 */
 #ifdef CONFIG_EXYNOS5
                sel = readl(clk-src_peric0);
 #else
                sel = readl(clk-src_peril0);
 #endif
                sel = (sel  24)  0xf;

                if (sel == 0x6)
                        sclk = get_pll_clk(MPLL);
                else if (sel == 0x7)
                        sclk = get_pll_clk(EPLL);
                else if (sel == 0x8)
                        sclk = get_pll_clk(VPLL);
                else
                        return 0;

                /*
                 * CLK_DIV_{PERIL3 | PERIC3}
                 * PWM_RATIO [3:0]
                 */
 #ifdef CONFIG_EXYNOS5
                ratio = readl(clk-div_peric3);
 #else
                ratio = readl(clk-div_peril3);
 #endif
                ratio = ratio  0xf;
        } else if (s5p_get_cpu_rev() == 1) {
                sclk = get_pll_clk(MPLL);
                ratio = 8;
        } else
                return 0;

        pclk = sclk / (ratio + 1);

        return pclk;
 }

 As listed above, the exynos_get_pwm_clk(() function is fully reusable
 for both Exynos4 and Exynos5. The #ifdef was used to get around the
 different clock names of Exynos4 and Exynos5.

 Another option here could be, that the differing clock name
 (src_peril0 for Exynos4 and src_peric0 for Exynos5) is resolved by
 change the src_peric0 to src_peril0 for Exynos5, and clearly
 commenting the reason for the deviation from the user manual. Would
 this approach be acceptable ?


 Using same clock's name is acceptable.

 But exynos4 clock structure and exynos5 clock structure are different.
 I requested removing all ifdefs in your patch.
 So, I will not allow such cases.
In that case S5PC1XX approach is suitable.

 +#ifdef CONFIG_EXYNOS4
 +#includeasm/arch/clock_exynos4.h
 +#elif defined CONFIG_EXYNOS5
 +#includeasm/arch/clock_exynos5.h
  #endif

 Then, we should do like this,

         struct exynos4_clock *clk =
                 (struct exynos4_clock *)samsung_get_base_clock();

         struct exynos5_clock *clk =
                 (struct exynos5_clock *)samsung_get_base_clock();

 how solve it?

 And you should consider variation by cpu revision.
 If Exynos5 revision1 is different from Exynos4 revision1, then?

I will resend patche based on s5pc1xx approch.
 Thanks.
 Minkyu Kang.
 --
 from. prom.
 www.promsoft.net



-- 
with warm regards,
Chander Kashyap
___
U-Boot mailing list
U-Boot@lists.denx.de

Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2012-01-05 Thread Chander Kashyap
Hi Minkyu Kang,

On 5 January 2012 12:13, Minkyu Kang proms...@gmail.com wrote:
 Dear Chander Kashyap,

 On 27 December 2011 17:48, Chander Kashyap chander.kash...@linaro.org wrote:
   Torsten Koschorrek koschor...@synertronixx.de
         scb9328         ARM920T (i.MXL)
  diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
  b/arch/arm/cpu/armv7/exynos/clock.c
  index b101f96..88e2fc0 100644
  --- a/arch/arm/cpu/armv7/exynos/clock.c
  +++ b/arch/arm/cpu/armv7/exynos/clock.c
  @@ -125,10 +125,14 @@ static unsigned long exynos_get_pwm_clk(void)
 
         if (s5p_get_cpu_rev() == 0) {
                 /*
  -                * CLK_SRC_PERIL0
  +                * CLK_SRC_{PERIL0 | PERIC0}
                  * PWM_SEL [27:24]
                  */
  +#ifdef CONFIG_EXYNOS5
  +               sel = readl(clk-src_peric0);
  +#else
                 sel = readl(clk-src_peril0);
  +#endif

 NAK.
 We don't allow to using ifdef for separating SoCs.
 Please refer s5pc1xx case for solve it.
 This comment apply to this patch globally.
 Please remove '#ifdef CONFIG_EXYNOS5'.

 I have tried to reuse the code. It is possible to remove
 #ifdef CONFIG_EXYNOS5' in clock.c with cpu_is_s5pcXXX check.
 Is it a acceptable solution? Or is it necessary to write SoC specific 
 function
 in clock.c as done in case of s5pc1xx/clock.c.

 Please Advice
 Removing CONFIG_EXYNOS5 and following s5pc1xx case will not allow to
 reuse the code in clock.c.
 What is the technical hindrance of not using ifdefs?

 No need to reuse the code, if SoCs are different.
 If need, please separate the functions.

Yes, though SoC's are different, the functionality in clock.c is
similar. The only difference is the clock name in the clock structure
for Exynos4 and Exynos5 but the functionality is exactly same in
clock.c. To accommodate this change in clock name #ifdef is used.

Following is the function in clock .c which uses #ifdef to accommodate
the different clock name in SoC's.

static unsigned long exynos_get_pwm_clk(void)
{
struct exynos_clock *clk =
(struct exynos_clock *)samsung_get_base_clock();
unsigned long pclk, sclk;
unsigned int sel;
unsigned int ratio;

if (s5p_get_cpu_rev() == 0) {
/*
 * CLK_SRC_{PERIL0 | PERIC0}
 * PWM_SEL [27:24]
 */
#ifdef CONFIG_EXYNOS5
sel = readl(clk-src_peric0);
#else
sel = readl(clk-src_peril0);
#endif
sel = (sel  24)  0xf;

if (sel == 0x6)
sclk = get_pll_clk(MPLL);
else if (sel == 0x7)
sclk = get_pll_clk(EPLL);
else if (sel == 0x8)
sclk = get_pll_clk(VPLL);
else
return 0;

/*
 * CLK_DIV_{PERIL3 | PERIC3}
 * PWM_RATIO [3:0]
 */
#ifdef CONFIG_EXYNOS5
ratio = readl(clk-div_peric3);
#else
ratio = readl(clk-div_peril3);
#endif
ratio = ratio  0xf;
} else if (s5p_get_cpu_rev() == 1) {
sclk = get_pll_clk(MPLL);
ratio = 8;
} else
return 0;

pclk = sclk / (ratio + 1);

return pclk;
}

As listed above, the exynos_get_pwm_clk(() function is fully reusable
for both Exynos4 and Exynos5. The #ifdef was used to get around the
different clock names of Exynos4 and Exynos5.

Another option here could be, that the differing clock name
(src_peril0 for Exynos4 and src_peric0 for Exynos5) is resolved by
change the src_peric0 to src_peril0 for Exynos5, and clearly
commenting the reason for the deviation from the user manual. Would
this approach be acceptable ?

Thanks for your comments. Please let know your opinion about the
points listed in this email.



 like this,

 unsigned long get_arm_clk(void)
 {
        if (cpu_is_s5pc110())
                return s5pc110_get_arm_clk();
        else
                return s5pc100_get_arm_clk();
 }

 Thanks.
 Minkyu Kang
 --
 from. prom.
 www.promsoft.net



-- 
with warm regards,
Chander Kashyap
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2012-01-05 Thread Wolfgang Denk
Dear Chander Kashyap,

In message canuqghhy8_6m1riva6rawry0pvrx5nnykxd_p+u340a0d4j...@mail.gmail.com 
you wrote:

  No need to reuse the code, if SoCs are different.
  If need, please separate the functions.
 
 Yes, though SoC's are different, the functionality in clock.c is
 similar. The only difference is the clock name in the clock structure
 for Exynos4 and Exynos5 but the functionality is exactly same in
 clock.c. To accommodate this change in clock name #ifdef is used.

If this is the only difference, then I suggest just to rename the
field in thesta structure.  Although it makes sense to follow the names
in the documentation, it is sometimes better tochose a more suitable
name - a comment in the header file should be sufficient to explain
the rename (and to provide an anchor in case something greps for the
name as used in the docs).

Maybe we can avoid both #ifdef's and code duplication this way?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH, MD: Wolfgang Denk  Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: w...@denx.de
What was sliced bread the greatest thing since?
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2012-01-05 Thread Minkyu Kang
Dear Chander Kashyap,

On 5 January 2012 19:31, Chander Kashyap chander.kash...@linaro.org wrote:
 Hi Minkyu Kang,

 On 5 January 2012 12:13, Minkyu Kang proms...@gmail.com wrote:
 Dear Chander Kashyap,

 On 27 December 2011 17:48, Chander Kashyap chander.kash...@linaro.org 
 wrote:
   Torsten Koschorrek koschor...@synertronixx.de
         scb9328         ARM920T (i.MXL)
  diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
  b/arch/arm/cpu/armv7/exynos/clock.c
  index b101f96..88e2fc0 100644
  --- a/arch/arm/cpu/armv7/exynos/clock.c
  +++ b/arch/arm/cpu/armv7/exynos/clock.c
  @@ -125,10 +125,14 @@ static unsigned long exynos_get_pwm_clk(void)
 
         if (s5p_get_cpu_rev() == 0) {
                 /*
  -                * CLK_SRC_PERIL0
  +                * CLK_SRC_{PERIL0 | PERIC0}
                  * PWM_SEL [27:24]
                  */
  +#ifdef CONFIG_EXYNOS5
  +               sel = readl(clk-src_peric0);
  +#else
                 sel = readl(clk-src_peril0);
  +#endif

 NAK.
 We don't allow to using ifdef for separating SoCs.
 Please refer s5pc1xx case for solve it.
 This comment apply to this patch globally.
 Please remove '#ifdef CONFIG_EXYNOS5'.

 I have tried to reuse the code. It is possible to remove
 #ifdef CONFIG_EXYNOS5' in clock.c with cpu_is_s5pcXXX check.
 Is it a acceptable solution? Or is it necessary to write SoC specific 
 function
 in clock.c as done in case of s5pc1xx/clock.c.

 Please Advice
 Removing CONFIG_EXYNOS5 and following s5pc1xx case will not allow to
 reuse the code in clock.c.
 What is the technical hindrance of not using ifdefs?

 No need to reuse the code, if SoCs are different.
 If need, please separate the functions.

 Yes, though SoC's are different, the functionality in clock.c is
 similar. The only difference is the clock name in the clock structure
 for Exynos4 and Exynos5 but the functionality is exactly same in
 clock.c. To accommodate this change in clock name #ifdef is used.

 Following is the function in clock .c which uses #ifdef to accommodate
 the different clock name in SoC's.

 static unsigned long exynos_get_pwm_clk(void)
 {
        struct exynos_clock *clk =
                (struct exynos_clock *)samsung_get_base_clock();
        unsigned long pclk, sclk;
        unsigned int sel;
        unsigned int ratio;

        if (s5p_get_cpu_rev() == 0) {
                /*
                 * CLK_SRC_{PERIL0 | PERIC0}
                 * PWM_SEL [27:24]
                 */
 #ifdef CONFIG_EXYNOS5
                sel = readl(clk-src_peric0);
 #else
                sel = readl(clk-src_peril0);
 #endif
                sel = (sel  24)  0xf;

                if (sel == 0x6)
                        sclk = get_pll_clk(MPLL);
                else if (sel == 0x7)
                        sclk = get_pll_clk(EPLL);
                else if (sel == 0x8)
                        sclk = get_pll_clk(VPLL);
                else
                        return 0;

                /*
                 * CLK_DIV_{PERIL3 | PERIC3}
                 * PWM_RATIO [3:0]
                 */
 #ifdef CONFIG_EXYNOS5
                ratio = readl(clk-div_peric3);
 #else
                ratio = readl(clk-div_peril3);
 #endif
                ratio = ratio  0xf;
        } else if (s5p_get_cpu_rev() == 1) {
                sclk = get_pll_clk(MPLL);
                ratio = 8;
        } else
                return 0;

        pclk = sclk / (ratio + 1);

        return pclk;
 }

 As listed above, the exynos_get_pwm_clk(() function is fully reusable
 for both Exynos4 and Exynos5. The #ifdef was used to get around the
 different clock names of Exynos4 and Exynos5.

 Another option here could be, that the differing clock name
 (src_peril0 for Exynos4 and src_peric0 for Exynos5) is resolved by
 change the src_peric0 to src_peril0 for Exynos5, and clearly
 commenting the reason for the deviation from the user manual. Would
 this approach be acceptable ?


Using same clock's name is acceptable.

But exynos4 clock structure and exynos5 clock structure are different.
I requested removing all ifdefs in your patch.
So, I will not allow such cases.

+#ifdef CONFIG_EXYNOS4
+#includeasm/arch/clock_exynos4.h
+#elif defined CONFIG_EXYNOS5
+#includeasm/arch/clock_exynos5.h
 #endif

Then, we should do like this,

        struct exynos4_clock *clk =
                (struct exynos4_clock *)samsung_get_base_clock();

        struct exynos5_clock *clk =
                (struct exynos5_clock *)samsung_get_base_clock();

how solve it?

And you should consider variation by cpu revision.
If Exynos5 revision1 is different from Exynos4 revision1, then?

Thanks.
Minkyu Kang.
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2012-01-04 Thread Chander Kashyap
Dear Minkyu Kang,

On 27 December 2011 14:18, Chander Kashyap chander.kash...@linaro.org wrote:
 Dear minkyu Kang

 On 23 December 2011 11:21, Chander Kashyap chander.kash...@linaro.org wrote:
 Dear Minkyu Kang,

 On 23 December 2011 09:51, Minkyu Kang proms...@gmail.com wrote:

 Dear Chander Kashyap,

 On 22 December 2011 19:52, Chander Kashyap chander.kash...@linaro.org 
 wrote:
  SMDK5250 board is based on Samsungs EXYNOS5250 SoC.
 
  Signed-off-by: Chander Kashyap chander.kash...@linaro.org
  ---
   MAINTAINERS                                      |    1 +
   arch/arm/cpu/armv7/exynos/clock.c                |   24 +-
   arch/arm/include/asm/arch-exynos/clock.h         |  232 +
   arch/arm/include/asm/arch-exynos/clock_exynos4.h |  255 +
   arch/arm/include/asm/arch-exynos/clock_exynos5.h |  352 +
   arch/arm/include/asm/arch-exynos/cpu.h           |   71 ++--
   arch/arm/include/asm/arch-exynos/cpu_exynos4.h   |   51 ++
   arch/arm/include/asm/arch-exynos/cpu_exynos5.h   |   39 ++
   arch/arm/include/asm/arch-exynos/gpio.h          |   51 ++-
   board/samsung/smdk5250/Makefile                  |   48 ++
   board/samsung/smdk5250/lowlevel_init.S           |  524 
  +++
   board/samsung/smdk5250/mem_setup.S               |  600 
  ++
   board/samsung/smdk5250/smdk5250.c                |  125 +
   board/samsung/smdk5250/smdk5250_setup.h          |  583 
  +
   boards.cfg                                       |    1 +
   include/configs/smdk5250.h                       |  182 +++
   16 files changed, 2867 insertions(+), 272 deletions(-)
   create mode 100644 arch/arm/include/asm/arch-exynos/clock_exynos4.h
   create mode 100644 arch/arm/include/asm/arch-exynos/clock_exynos5.h
   create mode 100644 arch/arm/include/asm/arch-exynos/cpu_exynos4.h
   create mode 100644 arch/arm/include/asm/arch-exynos/cpu_exynos5.h
   create mode 100644 board/samsung/smdk5250/Makefile
   create mode 100644 board/samsung/smdk5250/lowlevel_init.S
   create mode 100644 board/samsung/smdk5250/mem_setup.S
   create mode 100644 board/samsung/smdk5250/smdk5250.c
   create mode 100644 board/samsung/smdk5250/smdk5250_setup.h
   create mode 100644 include/configs/smdk5250.h

 Please split this patch for board and SoC.

 Ok


 
  diff --git a/MAINTAINERS b/MAINTAINERS
  index a56ca10..abf88be 100644
  --- a/MAINTAINERS
  +++ b/MAINTAINERS
  @@ -704,6 +704,7 @@ Chander Kashyap k.chan...@samsung.com
 
         origen                  ARM ARMV7 (EXYNOS4210 SoC)
         SMDKV310                ARM ARMV7 (EXYNOS4210 SoC)
  +       SMDK5250                ARM ARMV7 (EXYNOS5250 SoC)
 
   Torsten Koschorrek koschor...@synertronixx.de
         scb9328         ARM920T (i.MXL)
  diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
  b/arch/arm/cpu/armv7/exynos/clock.c
  index b101f96..88e2fc0 100644
  --- a/arch/arm/cpu/armv7/exynos/clock.c
  +++ b/arch/arm/cpu/armv7/exynos/clock.c
  @@ -125,10 +125,14 @@ static unsigned long exynos_get_pwm_clk(void)
 
         if (s5p_get_cpu_rev() == 0) {
                 /*
  -                * CLK_SRC_PERIL0
  +                * CLK_SRC_{PERIL0 | PERIC0}
                  * PWM_SEL [27:24]
                  */
  +#ifdef CONFIG_EXYNOS5
  +               sel = readl(clk-src_peric0);
  +#else
                 sel = readl(clk-src_peril0);
  +#endif

 NAK.
 We don't allow to using ifdef for separating SoCs.
 Please refer s5pc1xx case for solve it.
 This comment apply to this patch globally.
 Please remove '#ifdef CONFIG_EXYNOS5'.

 I have tried to reuse the code. It is possible to remove
 #ifdef CONFIG_EXYNOS5' in clock.c with cpu_is_s5pcXXX check.
 Is it a acceptable solution? Or is it necessary to write SoC specific 
 function
 in clock.c as done in case of s5pc1xx/clock.c.

 Please Advice
 Removing CONFIG_EXYNOS5 and following s5pc1xx case will not allow to
 reuse the code in clock.c.
 What is the technical hindrance of not using ifdefs?

 What are yours comments regarding this issue?
Any comments regrading the above discussion ?

 Thanks.
 Minkyu Kang.
 --
 from. prom.
 www.promsoft.net




 --
 with warm regards,
 Chander Kashyap



 --
 with warm regards,
 Chander Kashyap



-- 
with warm regards,
Chander Kashyap
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2012-01-04 Thread Minkyu Kang
Dear Chander Kashyap,

On 27 December 2011 17:48, Chander Kashyap chander.kash...@linaro.org wrote:
   Torsten Koschorrek koschor...@synertronixx.de
         scb9328         ARM920T (i.MXL)
  diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
  b/arch/arm/cpu/armv7/exynos/clock.c
  index b101f96..88e2fc0 100644
  --- a/arch/arm/cpu/armv7/exynos/clock.c
  +++ b/arch/arm/cpu/armv7/exynos/clock.c
  @@ -125,10 +125,14 @@ static unsigned long exynos_get_pwm_clk(void)
 
         if (s5p_get_cpu_rev() == 0) {
                 /*
  -                * CLK_SRC_PERIL0
  +                * CLK_SRC_{PERIL0 | PERIC0}
                  * PWM_SEL [27:24]
                  */
  +#ifdef CONFIG_EXYNOS5
  +               sel = readl(clk-src_peric0);
  +#else
                 sel = readl(clk-src_peril0);
  +#endif

 NAK.
 We don't allow to using ifdef for separating SoCs.
 Please refer s5pc1xx case for solve it.
 This comment apply to this patch globally.
 Please remove '#ifdef CONFIG_EXYNOS5'.

 I have tried to reuse the code. It is possible to remove
 #ifdef CONFIG_EXYNOS5' in clock.c with cpu_is_s5pcXXX check.
 Is it a acceptable solution? Or is it necessary to write SoC specific 
 function
 in clock.c as done in case of s5pc1xx/clock.c.

 Please Advice
 Removing CONFIG_EXYNOS5 and following s5pc1xx case will not allow to
 reuse the code in clock.c.
 What is the technical hindrance of not using ifdefs?

No need to reuse the code, if SoCs are different.
If need, please separate the functions.

like this,

unsigned long get_arm_clk(void)
{
if (cpu_is_s5pc110())
return s5pc110_get_arm_clk();
else
return s5pc100_get_arm_clk();
}

Thanks.
Minkyu Kang
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2011-12-27 Thread Chander Kashyap
Dear minkyu Kang

On 23 December 2011 11:21, Chander Kashyap chander.kash...@linaro.org wrote:
 Dear Minkyu Kang,

 On 23 December 2011 09:51, Minkyu Kang proms...@gmail.com wrote:

 Dear Chander Kashyap,

 On 22 December 2011 19:52, Chander Kashyap chander.kash...@linaro.org 
 wrote:
  SMDK5250 board is based on Samsungs EXYNOS5250 SoC.
 
  Signed-off-by: Chander Kashyap chander.kash...@linaro.org
  ---
   MAINTAINERS                                      |    1 +
   arch/arm/cpu/armv7/exynos/clock.c                |   24 +-
   arch/arm/include/asm/arch-exynos/clock.h         |  232 +
   arch/arm/include/asm/arch-exynos/clock_exynos4.h |  255 +
   arch/arm/include/asm/arch-exynos/clock_exynos5.h |  352 +
   arch/arm/include/asm/arch-exynos/cpu.h           |   71 ++--
   arch/arm/include/asm/arch-exynos/cpu_exynos4.h   |   51 ++
   arch/arm/include/asm/arch-exynos/cpu_exynos5.h   |   39 ++
   arch/arm/include/asm/arch-exynos/gpio.h          |   51 ++-
   board/samsung/smdk5250/Makefile                  |   48 ++
   board/samsung/smdk5250/lowlevel_init.S           |  524 
  +++
   board/samsung/smdk5250/mem_setup.S               |  600 
  ++
   board/samsung/smdk5250/smdk5250.c                |  125 +
   board/samsung/smdk5250/smdk5250_setup.h          |  583 
  +
   boards.cfg                                       |    1 +
   include/configs/smdk5250.h                       |  182 +++
   16 files changed, 2867 insertions(+), 272 deletions(-)
   create mode 100644 arch/arm/include/asm/arch-exynos/clock_exynos4.h
   create mode 100644 arch/arm/include/asm/arch-exynos/clock_exynos5.h
   create mode 100644 arch/arm/include/asm/arch-exynos/cpu_exynos4.h
   create mode 100644 arch/arm/include/asm/arch-exynos/cpu_exynos5.h
   create mode 100644 board/samsung/smdk5250/Makefile
   create mode 100644 board/samsung/smdk5250/lowlevel_init.S
   create mode 100644 board/samsung/smdk5250/mem_setup.S
   create mode 100644 board/samsung/smdk5250/smdk5250.c
   create mode 100644 board/samsung/smdk5250/smdk5250_setup.h
   create mode 100644 include/configs/smdk5250.h

 Please split this patch for board and SoC.

 Ok


 
  diff --git a/MAINTAINERS b/MAINTAINERS
  index a56ca10..abf88be 100644
  --- a/MAINTAINERS
  +++ b/MAINTAINERS
  @@ -704,6 +704,7 @@ Chander Kashyap k.chan...@samsung.com
 
         origen                  ARM ARMV7 (EXYNOS4210 SoC)
         SMDKV310                ARM ARMV7 (EXYNOS4210 SoC)
  +       SMDK5250                ARM ARMV7 (EXYNOS5250 SoC)
 
   Torsten Koschorrek koschor...@synertronixx.de
         scb9328         ARM920T (i.MXL)
  diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
  b/arch/arm/cpu/armv7/exynos/clock.c
  index b101f96..88e2fc0 100644
  --- a/arch/arm/cpu/armv7/exynos/clock.c
  +++ b/arch/arm/cpu/armv7/exynos/clock.c
  @@ -125,10 +125,14 @@ static unsigned long exynos_get_pwm_clk(void)
 
         if (s5p_get_cpu_rev() == 0) {
                 /*
  -                * CLK_SRC_PERIL0
  +                * CLK_SRC_{PERIL0 | PERIC0}
                  * PWM_SEL [27:24]
                  */
  +#ifdef CONFIG_EXYNOS5
  +               sel = readl(clk-src_peric0);
  +#else
                 sel = readl(clk-src_peril0);
  +#endif

 NAK.
 We don't allow to using ifdef for separating SoCs.
 Please refer s5pc1xx case for solve it.
 This comment apply to this patch globally.
 Please remove '#ifdef CONFIG_EXYNOS5'.

 I have tried to reuse the code. It is possible to remove
 #ifdef CONFIG_EXYNOS5' in clock.c with cpu_is_s5pcXXX check.
 Is it a acceptable solution? Or is it necessary to write SoC specific function
 in clock.c as done in case of s5pc1xx/clock.c.

 Please Advice
Removing CONFIG_EXYNOS5 and following s5pc1xx case will not allow to
reuse the code in clock.c.
What is the technical hindrance of not using ifdefs?

What are yours comments regarding this issue?

 Thanks.
 Minkyu Kang.
 --
 from. prom.
 www.promsoft.net




 --
 with warm regards,
 Chander Kashyap



-- 
with warm regards,
Chander Kashyap
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2011-12-22 Thread Minkyu Kang
Dear Chander Kashyap,

On 22 December 2011 19:52, Chander Kashyap chander.kash...@linaro.org wrote:
 SMDK5250 board is based on Samsungs EXYNOS5250 SoC.

 Signed-off-by: Chander Kashyap chander.kash...@linaro.org
 ---
  MAINTAINERS                                      |    1 +
  arch/arm/cpu/armv7/exynos/clock.c                |   24 +-
  arch/arm/include/asm/arch-exynos/clock.h         |  232 +
  arch/arm/include/asm/arch-exynos/clock_exynos4.h |  255 +
  arch/arm/include/asm/arch-exynos/clock_exynos5.h |  352 +
  arch/arm/include/asm/arch-exynos/cpu.h           |   71 ++--
  arch/arm/include/asm/arch-exynos/cpu_exynos4.h   |   51 ++
  arch/arm/include/asm/arch-exynos/cpu_exynos5.h   |   39 ++
  arch/arm/include/asm/arch-exynos/gpio.h          |   51 ++-
  board/samsung/smdk5250/Makefile                  |   48 ++
  board/samsung/smdk5250/lowlevel_init.S           |  524 +++
  board/samsung/smdk5250/mem_setup.S               |  600 
 ++
  board/samsung/smdk5250/smdk5250.c                |  125 +
  board/samsung/smdk5250/smdk5250_setup.h          |  583 +
  boards.cfg                                       |    1 +
  include/configs/smdk5250.h                       |  182 +++
  16 files changed, 2867 insertions(+), 272 deletions(-)
  create mode 100644 arch/arm/include/asm/arch-exynos/clock_exynos4.h
  create mode 100644 arch/arm/include/asm/arch-exynos/clock_exynos5.h
  create mode 100644 arch/arm/include/asm/arch-exynos/cpu_exynos4.h
  create mode 100644 arch/arm/include/asm/arch-exynos/cpu_exynos5.h
  create mode 100644 board/samsung/smdk5250/Makefile
  create mode 100644 board/samsung/smdk5250/lowlevel_init.S
  create mode 100644 board/samsung/smdk5250/mem_setup.S
  create mode 100644 board/samsung/smdk5250/smdk5250.c
  create mode 100644 board/samsung/smdk5250/smdk5250_setup.h
  create mode 100644 include/configs/smdk5250.h

Please split this patch for board and SoC.


 diff --git a/MAINTAINERS b/MAINTAINERS
 index a56ca10..abf88be 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -704,6 +704,7 @@ Chander Kashyap k.chan...@samsung.com

        origen                  ARM ARMV7 (EXYNOS4210 SoC)
        SMDKV310                ARM ARMV7 (EXYNOS4210 SoC)
 +       SMDK5250                ARM ARMV7 (EXYNOS5250 SoC)

  Torsten Koschorrek koschor...@synertronixx.de
        scb9328         ARM920T (i.MXL)
 diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
 b/arch/arm/cpu/armv7/exynos/clock.c
 index b101f96..88e2fc0 100644
 --- a/arch/arm/cpu/armv7/exynos/clock.c
 +++ b/arch/arm/cpu/armv7/exynos/clock.c
 @@ -125,10 +125,14 @@ static unsigned long exynos_get_pwm_clk(void)

        if (s5p_get_cpu_rev() == 0) {
                /*
 -                * CLK_SRC_PERIL0
 +                * CLK_SRC_{PERIL0 | PERIC0}
                 * PWM_SEL [27:24]
                 */
 +#ifdef CONFIG_EXYNOS5
 +               sel = readl(clk-src_peric0);
 +#else
                sel = readl(clk-src_peril0);
 +#endif

NAK.
We don't allow to using ifdef for separating SoCs.
Please refer s5pc1xx case for solve it.
This comment apply to this patch globally.
Please remove '#ifdef CONFIG_EXYNOS5'.

Thanks.
Minkyu Kang.
-- 
from. prom.
www.promsoft.net
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot


Re: [U-Boot] [PATCH 4/6] EEYNOS: Add SMDK5250 board support

2011-12-22 Thread Chander Kashyap
Dear Minkyu Kang,

On 23 December 2011 09:51, Minkyu Kang proms...@gmail.com wrote:

 Dear Chander Kashyap,

 On 22 December 2011 19:52, Chander Kashyap chander.kash...@linaro.org wrote:
  SMDK5250 board is based on Samsungs EXYNOS5250 SoC.
 
  Signed-off-by: Chander Kashyap chander.kash...@linaro.org
  ---
   MAINTAINERS                                      |    1 +
   arch/arm/cpu/armv7/exynos/clock.c                |   24 +-
   arch/arm/include/asm/arch-exynos/clock.h         |  232 +
   arch/arm/include/asm/arch-exynos/clock_exynos4.h |  255 +
   arch/arm/include/asm/arch-exynos/clock_exynos5.h |  352 +
   arch/arm/include/asm/arch-exynos/cpu.h           |   71 ++--
   arch/arm/include/asm/arch-exynos/cpu_exynos4.h   |   51 ++
   arch/arm/include/asm/arch-exynos/cpu_exynos5.h   |   39 ++
   arch/arm/include/asm/arch-exynos/gpio.h          |   51 ++-
   board/samsung/smdk5250/Makefile                  |   48 ++
   board/samsung/smdk5250/lowlevel_init.S           |  524 +++
   board/samsung/smdk5250/mem_setup.S               |  600 
  ++
   board/samsung/smdk5250/smdk5250.c                |  125 +
   board/samsung/smdk5250/smdk5250_setup.h          |  583 
  +
   boards.cfg                                       |    1 +
   include/configs/smdk5250.h                       |  182 +++
   16 files changed, 2867 insertions(+), 272 deletions(-)
   create mode 100644 arch/arm/include/asm/arch-exynos/clock_exynos4.h
   create mode 100644 arch/arm/include/asm/arch-exynos/clock_exynos5.h
   create mode 100644 arch/arm/include/asm/arch-exynos/cpu_exynos4.h
   create mode 100644 arch/arm/include/asm/arch-exynos/cpu_exynos5.h
   create mode 100644 board/samsung/smdk5250/Makefile
   create mode 100644 board/samsung/smdk5250/lowlevel_init.S
   create mode 100644 board/samsung/smdk5250/mem_setup.S
   create mode 100644 board/samsung/smdk5250/smdk5250.c
   create mode 100644 board/samsung/smdk5250/smdk5250_setup.h
   create mode 100644 include/configs/smdk5250.h

 Please split this patch for board and SoC.

Ok


 
  diff --git a/MAINTAINERS b/MAINTAINERS
  index a56ca10..abf88be 100644
  --- a/MAINTAINERS
  +++ b/MAINTAINERS
  @@ -704,6 +704,7 @@ Chander Kashyap k.chan...@samsung.com
 
         origen                  ARM ARMV7 (EXYNOS4210 SoC)
         SMDKV310                ARM ARMV7 (EXYNOS4210 SoC)
  +       SMDK5250                ARM ARMV7 (EXYNOS5250 SoC)
 
   Torsten Koschorrek koschor...@synertronixx.de
         scb9328         ARM920T (i.MXL)
  diff --git a/arch/arm/cpu/armv7/exynos/clock.c 
  b/arch/arm/cpu/armv7/exynos/clock.c
  index b101f96..88e2fc0 100644
  --- a/arch/arm/cpu/armv7/exynos/clock.c
  +++ b/arch/arm/cpu/armv7/exynos/clock.c
  @@ -125,10 +125,14 @@ static unsigned long exynos_get_pwm_clk(void)
 
         if (s5p_get_cpu_rev() == 0) {
                 /*
  -                * CLK_SRC_PERIL0
  +                * CLK_SRC_{PERIL0 | PERIC0}
                  * PWM_SEL [27:24]
                  */
  +#ifdef CONFIG_EXYNOS5
  +               sel = readl(clk-src_peric0);
  +#else
                 sel = readl(clk-src_peril0);
  +#endif

 NAK.
 We don't allow to using ifdef for separating SoCs.
 Please refer s5pc1xx case for solve it.
 This comment apply to this patch globally.
 Please remove '#ifdef CONFIG_EXYNOS5'.

I have tried to reuse the code. It is possible to remove
#ifdef CONFIG_EXYNOS5' in clock.c with cpu_is_s5pcXXX check.
Is it a acceptable solution? Or is it necessary to write SoC specific function
in clock.c as done in case of s5pc1xx/clock.c.

Please Advice

 Thanks.
 Minkyu Kang.
 --
 from. prom.
 www.promsoft.net




--
with warm regards,
Chander Kashyap
___
U-Boot mailing list
U-Boot@lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot