public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v6 1/4] EXYNOS5: Add gpio pin numbering feature
@ 2014-04-14  9:07 Akshay Saraswat
  2014-04-14 10:53 ` Lukasz Majewski
  0 siblings, 1 reply; 13+ messages in thread
From: Akshay Saraswat @ 2014-04-14  9:07 UTC (permalink / raw)
  To: u-boot

Hi Lukasz,

>Hi Akshay,
>
>I'm not Samsung tree maintainer, but by chance I've come across those
>patches and...
>
>First question - why have you omitted u-boot-samsung tree maintainer?
>I've added Minkyu to CC.
>

Minkyu has an email ID "promsoft at gmail.com" and I added that in CC.
Probably you don't know this email id :-)

>
>Also in the cover letter you claim that this patch was "build tested"
>for Exynos4 based boards. Why didn't you add at least one maintainer of
>those boards to CC?
>

In cover letter I have not mentioned anywhere that I have built or tested
these patches over Exynos4. Patch 2/4 says "Build tested" because Rajeshwari
did build images for Exynos4 boards and that was successfull but nobody tested
booting those images.
I do not possess any Exynos4 board. These patches are meant for Exynos5 only.
But Yes, there are compiler errors introduced for smkc100 because of this new
patch-set and I will fix them in the next patch-set.

>
>> +
>> +/* A list of valid GPIO numbers for the asm-generic/gpio.h interface
>> */ +enum exynos5_gpio_pin {
>> +	/* GPIO_PART1_STARTS */
>> +	EXYNOS5_GPIO_A00,	/* 0 */
>> +	EXYNOS5_GPIO_A01,
>> +	EXYNOS5_GPIO_A02,
>> +	EXYNOS5_GPIO_A03,
>> +	EXYNOS5_GPIO_A04,
>
>According to the patch description, you had a compilation error when
>were adding the support for Exynos 5250 and 5420. Why you fix the
>problem by rewriting the whole framework?
>

This framework is not intended to fix compiler warnings or errors but to make
GPIO numbering easy to remember and sequential, without any holes in between.

>
>IN the patch 2/4 you have:
>
>-		gpio_cfg_pin(start + i, GPIO_FUNC(0x2));
>-		gpio_set_pull(start + i, GPIO_PULL_NONE);
>-		gpio_set_drv(start + i, GPIO_DRV_4X);
>+		gpio_cfg_pin(start + i, S5P_GPIO_FUNC(0x2));
>+		gpio_set_pull(start + i, S5P_GPIO_PULL_NONE);
>+		gpio_set_drv(start + i, S5P_GPIO_DRV_4X);
>
>What is the rationale to change the name to S5P_GPIO and not stick to
>GPIO_FUNC? In which way gpios for Exynos5 are different than for
>Exynos4? Cannot we finally reuse the Exynos 4 and 5 code?
>

We have enum member GPIO_INPUT in common/cmd_gpio.c and GPIO_INPUT define
in arch-exynos/gpio.h. To remove such conflicts we renamed all s5p defines
from "GPIO_*" to "S5P_GPIO_*".
We are using the same s5p_gpio.c for both Exynos4 and 5 as far as I know.
I dont get the exact issue here. Do you want me to remove "S5P_". Is that it ?

>
>With the same patch:
>
>-  	case PERIPH_ID_UART1:
>-		bank = &gpio1->d0;
>-		start = 0;
>+		start = EXYNOS5_GPIO_D00;
>
>What is wrong with specifying the bank field? 
>Why your gpio command cannot use the bank approach?
>

Ultimately we are using banks and pin_nums specific to the bank only
after we extract exact bank from the sequential pin_num.

>
>And one more question: Is this work compliant with new driver model,
>which will be accepted at the merge window after the v2014.04 release?
>
>
>If not, then there is no point to review this code, since GPIO would
>need to be adjusted to use this framework.
>

Please explain more. I don't get this as well :-)

>--
>Best regards,
>
>Lukasz Majewski
>
>Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
>

Regards,
Akshay Saraswat

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v6 1/4] EXYNOS5: Add gpio pin numbering feature
@ 2014-04-14 14:55 Akshay Saraswat
  2014-04-14 15:23 ` Przemyslaw Marczak
  0 siblings, 1 reply; 13+ messages in thread
From: Akshay Saraswat @ 2014-04-14 14:55 UTC (permalink / raw)
  To: u-boot

Hi Minkyu, Simon and Lukasz,

>Dear Akshay,
>
>On 14/04/14 19:53, Lukasz Majewski wrote:
>> Hi Akshay,
>> 
>>> Hi Lukasz,
>>>
>>>> Hi Akshay,
>>>>
>>>> I'm not Samsung tree maintainer, but by chance I've come across those
>>>> patches and...
>>>>
>>>> First question - why have you omitted u-boot-samsung tree maintainer?
>>>> I've added Minkyu to CC.
>>>>
>>>
>>> Minkyu has an email ID "promsoft at gmail.com" and I added that in CC.
>>> Probably you don't know this email id :-)
>> 
>> I do know it :-), but this is not the official one.
>> 
>> Adding involved people to CC really speed up things :-)
>> 
>
>I am always sensing about SAMSUNG related patches.
>Please don't worry about it :)
>
>>>
>>>>
>>>> Also in the cover letter you claim that this patch was "build tested"
>>>> for Exynos4 based boards. Why didn't you add at least one maintainer
>>>> of those boards to CC?
>>>>
>>>
>>> In cover letter I have not mentioned anywhere that I have built or
>>> tested these patches over Exynos4. 
>>> Patch 2/4 says "Build tested"
>>> because Rajeshwari did build images for Exynos4 boards and that was
>>> successfull but nobody tested booting those images.
>> 
>> As Przemek written to you in the other mail. There is a build problem
>> with trats2/trats boards.
>
>Please fix it.
>
>> 
>>> I do not possess any Exynos4 board. 
>> 
>> That is why it is a good practice to ask maintainer's of those boards
>> to test it for you. 
>> 
>>> These patches are meant for
>>> Exynos5 only.
>
>No. please consider Exynos4 also.
>If you make patches for Exynos4 too, then it will be great job.
>Przemek or Lukasz will help your test.
>
>> 

I borrowed an Origen board and doing changes for Exynos4 as well.
I'll push next patch-set tomorrow with Exynos4 and 5 support together.

>> We will probably go with your approach to make (_finally_) the gpio code
>> consistent for Exynos4/5.
>> 
>>> But Yes, there are compiler errors introduced for
>>> smkc100 because of this new patch-set and I will fix them in the next
>>> patch-set.
>
>next patch-set means v7? right?
>

Yes, next patch set would be v7.

>> 
>> I'm a bit confused now. Was this patch set build tested or not? 
>> 
>>>
>>>>
>>>>> +
>>>>> +/* A list of valid GPIO numbers for the asm-generic/gpio.h
>>>>> interface */ +enum exynos5_gpio_pin {
>>>>> +	/* GPIO_PART1_STARTS */
>>>>> +	EXYNOS5_GPIO_A00,	/* 0 */
>>>>> +	EXYNOS5_GPIO_A01,
>>>>> +	EXYNOS5_GPIO_A02,
>>>>> +	EXYNOS5_GPIO_A03,
>>>>> +	EXYNOS5_GPIO_A04,
>>>>
>>>> According to the patch description, you had a compilation error when
>>>> were adding the support for Exynos 5250 and 5420. Why you fix the
>>>> problem by rewriting the whole framework?
>>>>
>>>
>>> This framework is not intended to fix compiler warnings or errors but
>>> to make GPIO numbering easy to remember and sequential, without any
>>> holes in between.
>> 
>> Samsung boards were swinging from part+bank+pin number approach to
>> sequential GPIO number from time to time. I think it is a good
>> time to clean things up. 
>> 
>>>
>>>>
>>>> IN the patch 2/4 you have:
>>>>
>>>> -		gpio_cfg_pin(start + i, GPIO_FUNC(0x2));
>>>> -		gpio_set_pull(start + i, GPIO_PULL_NONE);
>>>> -		gpio_set_drv(start + i, GPIO_DRV_4X);
>>>> +		gpio_cfg_pin(start + i, S5P_GPIO_FUNC(0x2));
>>>> +		gpio_set_pull(start + i, S5P_GPIO_PULL_NONE);
>>>> +		gpio_set_drv(start + i, S5P_GPIO_DRV_4X);
>>>>
>>>> What is the rationale to change the name to S5P_GPIO and not stick to
>>>> GPIO_FUNC? In which way gpios for Exynos5 are different than for
>>>> Exynos4? Cannot we finally reuse the Exynos 4 and 5 code?
>>>>
>>>
>>> We have enum member GPIO_INPUT in common/cmd_gpio.c and GPIO_INPUT
>>> define in arch-exynos/gpio.h. To remove such conflicts we renamed all
>>> s5p defines from "GPIO_*" to "S5P_GPIO_*".
>>> We are using the same s5p_gpio.c for both Exynos4 and 5 as far as I
>>> know. I dont get the exact issue here. Do you want me to remove
>>> "S5P_". Is that it ?
>> 
>> S5P_ corresponds to at most Exynos4 SoC (Up till S5PV310). However,
>> since the file is named s5p_gpio.c, then I think that S5P_ is a
>> appropriate prefix.
>
>Actually I have plan to rename from S5P_ to EXYNOS_. but not now.
>It look OK to me.
>
>> 
>>>
>>>>
>>>> With the same patch:
>>>>
>>>> -  	case PERIPH_ID_UART1:
>>>> -		bank = &gpio1->d0;
>>>> -		start = 0;
>>>> +		start = EXYNOS5_GPIO_D00;
>>>>
>>>> What is wrong with specifying the bank field? 
>>>> Why your gpio command cannot use the bank approach?
>>>>
>>>
>>> Ultimately we are using banks and pin_nums specific to the bank only
>>> after we extract exact bank from the sequential pin_num.
>> 
>> Ok.
>> 
>>>
>>>>
>>>> And one more question: Is this work compliant with new driver model,
>>>> which will be accepted at the merge window after the v2014.04
>>>> release?
>>>>
>>>>
>>>> If not, then there is no point to review this code, since GPIO would
>>>> need to be adjusted to use this framework.
>>>>
>>>
>>> Please explain more. I don't get this as well :-)
>> 
>> My point is that the new driver model (introduced by Simon) is going to
>> be included. I'm concern if after introduction of it we would need to
>> rewrite the gpio code to comply with it.
>> 
>>>
>>>> --
>>>> Best regards,
>>>>
>>>> Lukasz Majewski
>>>>
>>>> Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
>>>>
>>>
>>> Regards,
>>> Akshay Saraswat
>> 
>> 
>> 
>
>Thanks,
>Minkyu Kang.
>

Regards,
Akshay Saraswat

^ permalink raw reply	[flat|nested] 13+ messages in thread
* [U-Boot] [PATCH v6 0/4] Exynos5: Add GPIO numbering feature
@ 2014-04-12  9:43 Akshay Saraswat
  2014-04-12  9:43 ` [U-Boot] [PATCH v6 1/4] EXYNOS5: Add gpio pin " Akshay Saraswat
  0 siblings, 1 reply; 13+ messages in thread
From: Akshay Saraswat @ 2014-04-12  9:43 UTC (permalink / raw)
  To: u-boot

From: Akshay Saraswat <akshay.s@samsung.com>

Changes in V2:
	- Enabled CMD_GPIO as suggested by Simon Glass
	  and supported same for EXYNOS5.
Changes in V3:
	- New patch added to rename S5P GPIO definitions
	  to S5P_GPIO.
	- GPIO Table added to calculate the base address
	  of input gpio bank.
Changes in V4:
	- To have consistent 0..n-1 GPIO numbering the banks
	  are divided into different parts where ever they
	  have holes in them.
	- Function and table to support gpio command moved
	  to s5p-gpio driver.
	- Rebased on latest u-boot-samsung tree.
Changes in V5:
	- Rebased on latest u-boot-samsung tree.
	- Removed Exynos5 specific code in gpio driver api to
	  get bank.
	- Added #define HAVE_GENERIC_GPIO in config file
	  to remove conditinal CPU check in gpio driver.
Changes in V6:
	- Isolated config changes in a new patch.
	- Updated patches with corresponding changes for Exynos 5420.

Rajeshwari Shinde (4):
  S5P: Rename GPIO definitions
  EXYNOS5: Add gpio pin numbering feature
  EXYNOS5: GPIO: Support GPIO Command for EXYNOS5
  Config: Exynos5: Enable Generic GPIO and CMD configs

 arch/arm/cpu/armv7/exynos/pinmux.c       | 355 ++++++--------
 arch/arm/include/asm/arch-exynos/cpu.h   |  17 +-
 arch/arm/include/asm/arch-exynos/gpio.h  | 796 ++++++++++++++++++++++++++++++-
 arch/arm/include/asm/arch-s5pc1xx/gpio.h |  26 +-
 board/samsung/goni/goni.c                |   4 +-
 board/samsung/smdk5250/exynos5-dt.c      |  20 +-
 board/samsung/smdk5250/smdk5250.c        |  19 +-
 board/samsung/smdk5420/smdk5420.c        |  15 +-
 board/samsung/smdkc100/smdkc100.c        |   2 +-
 board/samsung/smdkv310/smdkv310.c        |  10 +-
 board/samsung/trats/trats.c              |   6 +-
 board/samsung/universal_c210/universal.c |  34 +-
 drivers/gpio/s5p_gpio.c                  | 169 ++++++-
 include/configs/exynos5-dt.h             |   3 +
 14 files changed, 1157 insertions(+), 319 deletions(-)

-- 
1.8.3.2

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2014-04-17  4:21 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-14  9:07 [U-Boot] [PATCH v6 1/4] EXYNOS5: Add gpio pin numbering feature Akshay Saraswat
2014-04-14 10:53 ` Lukasz Majewski
2014-04-14 12:42   ` Minkyu Kang
  -- strict thread matches above, loose matches on Subject: below --
2014-04-14 14:55 Akshay Saraswat
2014-04-14 15:23 ` Przemyslaw Marczak
2014-04-12  9:43 [U-Boot] [PATCH v6 0/4] Exynos5: Add GPIO " Akshay Saraswat
2014-04-12  9:43 ` [U-Boot] [PATCH v6 1/4] EXYNOS5: Add gpio pin " Akshay Saraswat
2014-04-12 20:30   ` Simon Glass
2014-04-14  7:17   ` Lukasz Majewski
2014-04-14 14:40     ` Simon Glass
2014-04-15  6:25       ` Lukasz Majewski
2014-04-17  4:21         ` Simon Glass
2014-04-14 15:15   ` Przemyslaw Marczak
2014-04-14 15:59     ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox