public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lukasz Majewski <l.majewski@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/4] Exynos5800: Add support for Exynos5800
Date: Mon, 03 Nov 2014 09:34:12 +0100	[thread overview]
Message-ID: <20141103093412.0e9aa370@amdc2363> (raw)
In-Reply-To: <1414757673-32409-3-git-send-email-human.hwang@samsung.com>

Hi Hyungwon,

> The gpios of Exynos5800 are different from that of Exynos5420. This
> patch adds the gpio information and table of Exynos5800.
> 
> Signed-off-by: Hyungwon Hwang <human.hwang@samsung.com>
> ---
>  arch/arm/include/asm/arch-exynos/gpio.h | 31
> +++++++++++++++++++++++++++++--
> drivers/gpio/s5p_gpio.c                 |  4 +++- 2 files changed, 32
> insertions(+), 3 deletions(-)
> 
> diff --git a/arch/arm/include/asm/arch-exynos/gpio.h
> b/arch/arm/include/asm/arch-exynos/gpio.h index 431ae3a..8f82ef0
> 100644 --- a/arch/arm/include/asm/arch-exynos/gpio.h
> +++ b/arch/arm/include/asm/arch-exynos/gpio.h
> @@ -1368,11 +1368,21 @@ static struct gpio_info
> exynos5420_gpio_data[EXYNOS5420_GPIO_NUM_PARTS] =
> { { EXYNOS5420_GPIO_PART5_BASE, EXYNOS5420_GPIO_MAX_PORT }, };
>  
> +#define EXYNOS5800_GPIO_NUM_PARTS	4
> +static struct gpio_info
> exynos5800_gpio_data[EXYNOS5800_GPIO_NUM_PARTS] = {
> +	{ EXYNOS5420_GPIO_PART1_BASE,
> EXYNOS5420_GPIO_MAX_PORT_PART_1 },
> +	{ EXYNOS5420_GPIO_PART2_BASE,
> EXYNOS5420_GPIO_MAX_PORT_PART_2 },
> +	{ EXYNOS5420_GPIO_PART3_BASE,
> EXYNOS5420_GPIO_MAX_PORT_PART_3 },
> +	{ EXYNOS5420_GPIO_PART4_BASE,
> EXYNOS5420_GPIO_MAX_PORT_PART_4 }, +};
> +
>  static inline struct gpio_info *get_gpio_data(void)
>  {
>  	if (cpu_is_exynos5()) {
> -		if (proid_is_exynos5420() || proid_is_exynos5800())
> +		if (proid_is_exynos5420())
>  			return exynos5420_gpio_data;
> +		else if (proid_is_exynos5800())
> +			return exynos5800_gpio_data;
>  		else
>  			return exynos5_gpio_data;
>  	} else if (cpu_is_exynos4()) {
> @@ -1388,8 +1398,10 @@ static inline struct gpio_info
> *get_gpio_data(void) static inline unsigned int get_bank_num(void)
>  {
>  	if (cpu_is_exynos5()) {
> -		if (proid_is_exynos5420() || proid_is_exynos5800())
> +		if (proid_is_exynos5420())
>  			return EXYNOS5420_GPIO_NUM_PARTS;
> +		if (proid_is_exynos5800())
> +			return EXYNOS5800_GPIO_NUM_PARTS;

I'm just wondering if Exynos5800 and Exynos5420 are not GPIO compatible?

>  		else
>  			return EXYNOS5_GPIO_NUM_PARTS;
>  	} else if (cpu_is_exynos4()) {
> @@ -1493,6 +1505,21 @@ static const struct gpio_name_num_table
> exynos5420_gpio_table[] = { { 0 }
>  };
>  
> +static const struct gpio_name_num_table exynos5800_gpio_table[] = {
> +	GPIO_ENTRY('x', EXYNOS5420_GPIO_X00, EXYNOS5420_GPIO_C00, 0),
> +	GPIO_ENTRY('c', EXYNOS5420_GPIO_C00, EXYNOS5420_GPIO_D10, 0),
> +	GPIO_ENTRY('d', EXYNOS5420_GPIO_D10, EXYNOS5420_GPIO_Y00, 0),
> +	GPIO_ENTRY('y', EXYNOS5420_GPIO_Y00, EXYNOS5420_GPIO_E00, 0),
> +	GPIO_ENTRY('e', EXYNOS5420_GPIO_E00, EXYNOS5420_GPIO_F00, 0),
> +	GPIO_ENTRY('f', EXYNOS5420_GPIO_F00, EXYNOS5420_GPIO_G00, 0),
> +	GPIO_ENTRY('g', EXYNOS5420_GPIO_G00, EXYNOS5420_GPIO_J40, 0),
> +	GPIO_ENTRY('j', EXYNOS5420_GPIO_J40, EXYNOS5420_GPIO_A00, 0),
> +	GPIO_ENTRY('a', EXYNOS5420_GPIO_A00, EXYNOS5420_GPIO_B00, 0),
> +	GPIO_ENTRY('b', EXYNOS5420_GPIO_B00, EXYNOS5420_GPIO_H00, 0),
> +	GPIO_ENTRY('h', EXYNOS5420_GPIO_H00, EXYNOS5420_GPIO_Z0, 0),
> +	{ 0 }
> +};
> +
>  void gpio_cfg_pin(int gpio, int cfg);
>  void gpio_set_pull(int gpio, int mode);
>  void gpio_set_drv(int gpio, int mode);
> diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c
> index bcf44eb..bed7cd7 100644
> --- a/drivers/gpio/s5p_gpio.c
> +++ b/drivers/gpio/s5p_gpio.c
> @@ -57,11 +57,13 @@ static inline int s5p_name_to_gpio(const char
> *name) */
>  #if defined(CONFIG_EXYNOS4) || defined(CONFIG_EXYNOS5)
>  	if (cpu_is_exynos5()) {
> -		if (proid_is_exynos5420() || proid_is_exynos5800()) {
> +		if (proid_is_exynos5420()) {
>  			tabp = exynos5420_gpio_table;
>  			irregular_bank_name = 'y';
>  			irregular_set_number = '7';
>  			irregular_bank_base = EXYNOS5420_GPIO_Y70;
> +		} else if (proid_is_exynos5800()) {
> +			tabp = exynos5800_gpio_table;
>  		} else {
>  			tabp = exynos5_gpio_table;
>  			irregular_bank_name = 'c';



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

  reply	other threads:[~2014-11-03  8:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-31 12:14 [U-Boot] [PATCH v2 0/4] Adds support for Exynos5422 odroid xu3 board Hyungwon Hwang
2014-10-31 12:14 ` [U-Boot] [PATCH v2 1/4] exynos5: fix GPIO information of exynos5420 Hyungwon Hwang
2014-10-31 12:14 ` [U-Boot] [PATCH v2 2/4] Exynos5800: Add support for Exynos5800 Hyungwon Hwang
2014-11-03  8:34   ` Lukasz Majewski [this message]
2014-11-04  1:26     ` Hyungwon Hwang
2014-10-31 12:14 ` [U-Boot] [PATCH v2 3/4] odroid: make some macros common Hyungwon Hwang
2014-11-03  8:51   ` Lukasz Majewski
2014-11-04  1:49     ` Hyungwon Hwang
2014-11-04  8:29       ` Lukasz Majewski
2014-11-04 10:56         ` Minkyu Kang
2014-10-31 12:14 ` [U-Boot] [PATCH v2 4/4] Odroid-XU3: Add support for Odroid-XU3 Hyungwon Hwang
2014-11-03  9:09   ` Lukasz Majewski
2014-11-04  5:07 ` [U-Boot] [PATCH v2 0/4] Adds support for Exynos5422 odroid xu3 board Jaehoon Chung

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=20141103093412.0e9aa370@amdc2363 \
    --to=l.majewski@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