public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v8 1/2] S5P: Exynos: Add GPIO pin numbering and rename definitions
@ 2014-04-16 13:27 Akshay Saraswat
  2014-04-16 13:48 ` Przemyslaw Marczak
  0 siblings, 1 reply; 9+ messages in thread
From: Akshay Saraswat @ 2014-04-16 13:27 UTC (permalink / raw)
  To: u-boot

Dear Jaehoon Chung,

>Hi, Akshay.
>
>Did you test exynos4 board?
>I have tested your patch-set with the exynos4 board(TRATS2).
>It didn't work. 
>

No, I didn't test it over Exynos4 boards. I don't have any working.
Thanks for testing. :-)

>
>Occurred DATA_ABORT.
>gpio_set_pull(EXYNOS4x12_GPIO_X15,...);
>
>Add the comment at below.
>
>On 04/16/2014 02:32 PM, Akshay Saraswat wrote:
>> This patch includes following changes :
>> * Adds gpio pin numbering support for EXYNOS SOCs.
>>   To have consistent 0..n-1 GPIO numbering the banks are divided
>>   into different parts where ever they have holes in them.
>> 
>> * Rename GPIO definitions from GPIO_... to S5P_GPIO_...
>>   These changes were done to enable cmd_gpio for EXYNOS and
>>   cmd_gpio has GPIO_INPUT same as s5p_gpio driver and hence
>>   getting a error during compilation.
>> 
>> * Adds support for name to gpio conversion in s5p_gpio to enable
>>   gpio command EXYNOS SoCs. Function has been added to asm/gpio.h
>>   to decode the input gpio name to gpio number.
>>   Example: SMDK5420 # gpio set gpa00
>> 
>> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
>> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
>> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
>> ---
>>  arch/arm/cpu/armv7/exynos/pinmux.c       |  403 +++----
>>  arch/arm/include/asm/arch-exynos/cpu.h   |   17 +-
>>  arch/arm/include/asm/arch-exynos/gpio.h  | 1778 +++++++++++++++++++++++++-----
>>  arch/arm/include/asm/arch-s5pc1xx/gpio.h |  941 +++++++++++++---
>>  board/samsung/arndale/arndale.c          |   11 +-
>>  board/samsung/goni/goni.c                |   26 +-
>>  board/samsung/smdk5250/exynos5-dt.c      |   20 +-
>>  board/samsung/smdk5250/smdk5250.c        |   19 +-
>>  board/samsung/smdk5420/smdk5420.c        |   15 +-
>>  board/samsung/smdkc100/smdkc100.c        |    5 +-
>>  board/samsung/smdkv310/smdkv310.c        |   17 +-
>>  board/samsung/trats/trats.c              |   39 +-
>>  board/samsung/trats2/trats2.c            |   74 +-
>>  board/samsung/universal_c210/universal.c |   51 +-
>>  drivers/gpio/s5p_gpio.c                  |  194 +++-
>>  15 files changed, 2779 insertions(+), 831 deletions(-)
>> 
>> diff --git a/arch/arm/cpu/armv7/exynos/pinmux.c b/arch/arm/cpu/armv7/exynos/pinmux.c
>> index 9edb475..e26eb51 100644
>> --- a/arch/arm/cpu/armv7/exynos/pinmux.c
>> +++ b/arch/arm/cpu/armv7/exynos/pinmux.c
>> @@ -13,30 +13,23 @@
>
>[..snip..]
>
>> -
>> +#if 0
>>  /* functions */
>>  void s5p_gpio_cfg_pin(struct s5p_gpio_bank *bank, int gpio, int cfg);
>>  void s5p_gpio_direction_output(struct s5p_gpio_bank *bank, int gpio, int en);
>> @@ -244,6 +29,7 @@ unsigned int s5p_gpio_get_value(struct s5p_gpio_bank *bank, int gpio);
>>  void s5p_gpio_set_pull(struct s5p_gpio_bank *bank, int gpio, int mode);
>>  void s5p_gpio_set_drv(struct s5p_gpio_bank *bank, int gpio, int mode);
>>  void s5p_gpio_set_rate(struct s5p_gpio_bank *bank, int gpio, int mode);
>> +#endif
>
>Why did you use the "#if 0 ~ #endif".
>If it didn't need to use, it can be removed, isn't?
>

Apologies, missed it while cleanup. Will remove it.

>
>Best Regards,
>Jaehoon Chung
>

Regards,
Akshay Saraswat

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [U-Boot] [PATCH v8 1/2] S5P: Exynos: Add GPIO pin numbering and rename definitions
@ 2014-04-16 13:20 Akshay Saraswat
  2014-04-16 13:47 ` Przemyslaw Marczak
  0 siblings, 1 reply; 9+ messages in thread
From: Akshay Saraswat @ 2014-04-16 13:20 UTC (permalink / raw)
  To: u-boot

Thanks for testing.
Please read inline replies.

>Hello Akshay,
>  04/16/2014 07:32 AM, Akshay Saraswat wrote:
>> This patch includes following changes :
>> * Adds gpio pin numbering support for EXYNOS SOCs.
>>    To have consistent 0..n-1 GPIO numbering the banks are divided
>>    into different parts where ever they have holes in them.
>>
>> * Rename GPIO definitions from GPIO_... to S5P_GPIO_...
>>    These changes were done to enable cmd_gpio for EXYNOS and
>>    cmd_gpio has GPIO_INPUT same as s5p_gpio driver and hence
>>    getting a error during compilation.
>>
>> * Adds support for name to gpio conversion in s5p_gpio to enable
>>    gpio command EXYNOS SoCs. Function has been added to asm/gpio.h
>>    to decode the input gpio name to gpio number.
>>    Example: SMDK5420 # gpio set gpa00
>>
>> Signed-off-by: Leela Krishna Amudala <l.krishna@samsung.com>
>> Signed-off-by: Rajeshwari Shinde <rajeshwari.s@samsung.com>
>> Signed-off-by: Akshay Saraswat <akshay.s@samsung.com>
>> ---
>>   arch/arm/cpu/armv7/exynos/pinmux.c       |  403 +++----
>>   arch/arm/include/asm/arch-exynos/cpu.h   |   17 +-
>>   arch/arm/include/asm/arch-exynos/gpio.h  | 1778 +++++++++++++++++++++++++-----
>>   arch/arm/include/asm/arch-s5pc1xx/gpio.h |  941 +++++++++++++---
>>   board/samsung/arndale/arndale.c          |   11 +-
>>   board/samsung/goni/goni.c                |   26 +-
>>   board/samsung/smdk5250/exynos5-dt.c      |   20 +-
>>   board/samsung/smdk5250/smdk5250.c        |   19 +-
>>   board/samsung/smdk5420/smdk5420.c        |   15 +-
>>   board/samsung/smdkc100/smdkc100.c        |    5 +-
>>   board/samsung/smdkv310/smdkv310.c        |   17 +-
>>   board/samsung/trats/trats.c              |   39 +-
>>   board/samsung/trats2/trats2.c            |   74 +-
>>   board/samsung/universal_c210/universal.c |   51 +-
>>   drivers/gpio/s5p_gpio.c                  |  194 +++-
>>   15 files changed, 2779 insertions(+), 831 deletions(-)
>>
>>
>
>You introduced new method for gpio numbering and I don't know why are 
>you using macro like this:
>"exynos_gpio_get(2, EXYNOS4X12_GPIO_X33)"
>and also new style like only "EXYNOS4X12_GPIO_X33".
>

Even I was wondering why such a macro lies in config file.
But i2c driver is looking for it, so had to modify and keep it.

>
>Those are two different numbers and can't be given to s5p_gpio driver 
>which interprets only new gpio numbering method.
>This code can't work properly.
>

Since, sequential pin number to bank+pin generation is same everywhere,
I thought it's ok to just replace it. Probably the enum mapping has faults.
Need to recalculate.

>
>Please remove old macros and use only proper gpio enum in boards config 
>files.
>We don't need any "get" macro if all gpio numbers are defined explicitly.
>
>You should also modify proper dts files in arch/arm/dts/* .
>
>
>I tested your changes with enums only and after change proper dts file 
>for trats2 there is still data abort.
>So this means that probably enums are not mapped correctly to proper 
>gpio bank addresses.
>
>Do you have an documentation for Exynos4 socs?
>
>I think that this should be checked again with documentation and 
>compiled next to the current code which is simple and just works.
>
>There are also some warnings when checking by checkpatch script.
>

Sure, will fix it. :-)

>
>Thanks
>-- 
>Przemyslaw Marczak
>Samsung R&D Institute Poland
>Samsung Electronics
>p.marczak at samsung.com
>

Regards,
Akshay Saraswat

^ permalink raw reply	[flat|nested] 9+ messages in thread
* [U-Boot] [PATCH v8 0/2] Exynos5: Add GPIO numbering feature
@ 2014-04-16  5:32 Akshay Saraswat
  2014-04-16  5:32 ` [U-Boot] [PATCH v8 1/2] S5P: Exynos: Add GPIO pin numbering and rename definitions Akshay Saraswat
  0 siblings, 1 reply; 9+ messages in thread
From: Akshay Saraswat @ 2014-04-16  5:32 UTC (permalink / raw)
  To: u-boot

Did ./MAKEALL -a arm and found all Exynos/S5P related boards
compiled successfully.
Couldn't test booting over all of them.
Tested U-Boot bootup over SMDK5420, SMDK5250, Snow.
Requesting maintaners to test once over affected SoCs/boards.

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.
Changes in V7:
	- Added changes for other SoCs like Exynos 4412, 4210 etc.
Changes in V8:
	- Changed Subject of patch 2/2 to reflect affected SoCs/boards.
	- Fixed arndale board compile time errors introduced due to
	  patch-set v7.

Akshay Saraswat (2):
  S5P: Exynos: Add GPIO pin numbering and rename definitions
  S5P: Exynos: Config: Enable Generic GPIO and CMD configs

 arch/arm/cpu/armv7/exynos/pinmux.c       |  403 +++----
 arch/arm/include/asm/arch-exynos/cpu.h   |   17 +-
 arch/arm/include/asm/arch-exynos/gpio.h  | 1778 +++++++++++++++++++++++++-----
 arch/arm/include/asm/arch-s5pc1xx/gpio.h |  941 +++++++++++++---
 board/samsung/arndale/arndale.c          |   11 +-
 board/samsung/goni/goni.c                |   26 +-
 board/samsung/smdk5250/exynos5-dt.c      |   20 +-
 board/samsung/smdk5250/smdk5250.c        |   19 +-
 board/samsung/smdk5420/smdk5420.c        |   15 +-
 board/samsung/smdkc100/smdkc100.c        |    5 +-
 board/samsung/smdkv310/smdkv310.c        |   17 +-
 board/samsung/trats/trats.c              |   39 +-
 board/samsung/trats2/trats2.c            |   74 +-
 board/samsung/universal_c210/universal.c |   51 +-
 drivers/gpio/s5p_gpio.c                  |  194 +++-
 include/configs/arndale.h                |    1 +
 include/configs/exynos5-dt.h             |    3 +
 include/configs/origen.h                 |    1 +
 include/configs/s5p_goni.h               |    5 +-
 include/configs/s5pc210_universal.h      |   17 +-
 include/configs/smdkc100.h               |    1 +
 include/configs/smdkv310.h               |    2 +
 include/configs/trats.h                  |    9 +-
 include/configs/trats2.h                 |    5 +-
 24 files changed, 2807 insertions(+), 847 deletions(-)

-- 
1.8.3.2

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

end of thread, other threads:[~2014-04-16 14:59 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-16 13:27 [U-Boot] [PATCH v8 1/2] S5P: Exynos: Add GPIO pin numbering and rename definitions Akshay Saraswat
2014-04-16 13:48 ` Przemyslaw Marczak
2014-04-16 14:48   ` Simon Glass
2014-04-16 14:59     ` Przemyslaw Marczak
  -- strict thread matches above, loose matches on Subject: below --
2014-04-16 13:20 Akshay Saraswat
2014-04-16 13:47 ` Przemyslaw Marczak
2014-04-16  5:32 [U-Boot] [PATCH v8 0/2] Exynos5: Add GPIO numbering feature Akshay Saraswat
2014-04-16  5:32 ` [U-Boot] [PATCH v8 1/2] S5P: Exynos: Add GPIO pin numbering and rename definitions Akshay Saraswat
2014-04-16 11:38   ` Jaehoon Chung
2014-04-16 12:17   ` Przemyslaw Marczak

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