diff mbox series

[U-Boot,01/18] gpio: mpc8xxx: add support for Layerscape SoC

Message ID 1534986905-5071-1-git-send-email-ying.zhang22455@nxp.com
State Changes Requested
Delegated to: York Sun
Headers show
Series [U-Boot,01/18] gpio: mpc8xxx: add support for Layerscape SoC | expand

Commit Message

Zhang Ying-22455 Aug. 23, 2018, 1:14 a.m. UTC
From: Zhang Ying-22455 <ying.zhang22455@nxp.com>

 * Add mpc8xxx_gpio_plat for for Layerscape SoC
 * Make the mpc8xxx driver capable of handling Layerscape Soc.

Signed-off-by: Zhang Ying-22455 <ying.zhang22455@nxp.com>
---
 arch/arm/include/asm/arch-fsl-layerscape/gpio.h    | 24 ++++++++++++++++++++++
 .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  2 ++
 arch/arm/include/asm/arch-ls102xa/gpio.h           |  6 ++++++
 drivers/gpio/mpc8xxx_gpio.c                        |  1 +
 4 files changed, 33 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-fsl-layerscape/gpio.h

Comments

York Sun Aug. 23, 2018, 3:27 p.m. UTC | #1
On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
> From: Zhang Ying-22455 <ying.zhang22455@nxp.com>
> 
>  * Add mpc8xxx_gpio_plat for for Layerscape SoC
>  * Make the mpc8xxx driver capable of handling Layerscape Soc.
> 


This looks weird. Why don't you rename mpc8xxx_gpio driver to be generic?

York
York Sun Sept. 21, 2018, 9:05 p.m. UTC | #2
On 08/23/2018 08:27 AM, York Sun wrote:
> On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
>> From: Zhang Ying-22455 <ying.zhang22455@nxp.com>
>>
>>  * Add mpc8xxx_gpio_plat for for Layerscape SoC
>>  * Make the mpc8xxx driver capable of handling Layerscape Soc.
>>
> 
> 
> This looks weird. Why don't you rename mpc8xxx_gpio driver to be generic?
> 

Are you going to rename the driver?

York
Zhang Ying-22455 Sept. 28, 2018, 3:54 a.m. UTC | #3
Hi, York,
	I prefer not to rename it. This is consistent with Linux kernel.

-----Original Message-----
From: York Sun 
Sent: 2018年9月22日 5:06
To: Ying Zhang <ying.zhang22455@nxp.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH 01/18] gpio: mpc8xxx: add support for Layerscape SoC

On 08/23/2018 08:27 AM, York Sun wrote:
> On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
>> From: Zhang Ying-22455 <ying.zhang22455@nxp.com>
>>
>>  * Add mpc8xxx_gpio_plat for for Layerscape SoC
>>  * Make the mpc8xxx driver capable of handling Layerscape Soc.
>>
> 
> 
> This looks weird. Why don't you rename mpc8xxx_gpio driver to be generic?
> 

Are you going to rename the driver?

York
York Sun Oct. 1, 2018, 5:51 p.m. UTC | #4
On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
> From: Zhang Ying-22455 <ying.zhang22455@nxp.com>
> 
>  * Add mpc8xxx_gpio_plat for for Layerscape SoC
>  * Make the mpc8xxx driver capable of handling Layerscape Soc.
> 
> Signed-off-by: Zhang Ying-22455 <ying.zhang22455@nxp.com>
> ---
>  arch/arm/include/asm/arch-fsl-layerscape/gpio.h    | 24 ++++++++++++++++++++++
>  .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  2 ++
>  arch/arm/include/asm/arch-ls102xa/gpio.h           |  6 ++++++
>  drivers/gpio/mpc8xxx_gpio.c                        |  1 +
>  4 files changed, 33 insertions(+)
>  create mode 100644 arch/arm/include/asm/arch-fsl-layerscape/gpio.h
> 
> diff --git a/arch/arm/include/asm/arch-fsl-layerscape/gpio.h b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h
> new file mode 100644
> index 0000000..b6afcaa
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h
> @@ -0,0 +1,24 @@
> +/*
> + * Copyright 2008-2016 Freescale Semiconductor, Inc.
> + * Copyright 2017-2018 NXP Semiconductor
> + *
> + * SPDX-License-Identifier:     GPL-2.0
> + */
> +
> +#ifndef _ASM_ARCH_LAYERSCAPE_GPIO_H_
> +#define _ASM_ARCH_LAYERSCAPE_GPIO_H_
> +
> +#ifdef CONFIG_FSL_LSCH2
> +#include <asm/arch/immap_lsch2.h>
> +#endif
> +#ifdef CONFIG_FSL_LSCH3
> +#include <asm/arch/immap_lsch3.h>
> +#endif
> +
> +struct mpc8xxx_gpio_plat {
> +	ulong addr;
> +	unsigned long size;
> +	uint ngpios;
> +};
> +
> +#endif
> diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
> index be0a6ae..18f6875 100644
> --- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
> +++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
> @@ -650,6 +650,7 @@ struct ccsr_serdes {
>  	u8	res_19a0[0x2000-0x19a0];	/* from 0x19a0 to 0x1fff */
>  };
>  
> +#ifndef CONFIG_MPC8XXX_GPIO
>  struct ccsr_gpio {
>  	u32	gpdir;
>  	u32	gpodr;
> @@ -659,6 +660,7 @@ struct ccsr_gpio {
>  	u32	gpicr;
>  	u32	gpibe;
>  };
> +#endif

Why do you need to keep this code?

York
York Sun Oct. 1, 2018, 5:52 p.m. UTC | #5
On 08/22/2018 06:15 PM, ying.zhang22455@nxp.com wrote:
> From: Zhang Ying-22455 <ying.zhang22455@nxp.com>
> 
>  * Add mpc8xxx_gpio_plat for for Layerscape SoC
>  * Make the mpc8xxx driver capable of handling Layerscape Soc.
> 
> Signed-off-by: Zhang Ying-22455 <ying.zhang22455@nxp.com>
> ---
>  arch/arm/include/asm/arch-fsl-layerscape/gpio.h    | 24 ++++++++++++++++++++++
>  .../include/asm/arch-fsl-layerscape/immap_lsch2.h  |  2 ++
>  arch/arm/include/asm/arch-ls102xa/gpio.h           |  6 ++++++
>  drivers/gpio/mpc8xxx_gpio.c                        |  1 +
>  4 files changed, 33 insertions(+)
>  create mode 100644 arch/arm/include/asm/arch-fsl-layerscape/gpio.h
> 
> diff --git a/arch/arm/include/asm/arch-fsl-layerscape/gpio.h b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h
> new file mode 100644
> index 0000000..b6afcaa
> --- /dev/null
> +++ b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h
> @@ -0,0 +1,24 @@
> +/*
> + * Copyright 2008-2016 Freescale Semiconductor, Inc.
> + * Copyright 2017-2018 NXP Semiconductor
> + *
> + * SPDX-License-Identifier:     GPL-2.0
> + */
> +

Please use the new SPDX format.

York
diff mbox series

Patch

diff --git a/arch/arm/include/asm/arch-fsl-layerscape/gpio.h b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h
new file mode 100644
index 0000000..b6afcaa
--- /dev/null
+++ b/arch/arm/include/asm/arch-fsl-layerscape/gpio.h
@@ -0,0 +1,24 @@ 
+/*
+ * Copyright 2008-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017-2018 NXP Semiconductor
+ *
+ * SPDX-License-Identifier:     GPL-2.0
+ */
+
+#ifndef _ASM_ARCH_LAYERSCAPE_GPIO_H_
+#define _ASM_ARCH_LAYERSCAPE_GPIO_H_
+
+#ifdef CONFIG_FSL_LSCH2
+#include <asm/arch/immap_lsch2.h>
+#endif
+#ifdef CONFIG_FSL_LSCH3
+#include <asm/arch/immap_lsch3.h>
+#endif
+
+struct mpc8xxx_gpio_plat {
+	ulong addr;
+	unsigned long size;
+	uint ngpios;
+};
+
+#endif
diff --git a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
index be0a6ae..18f6875 100644
--- a/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
+++ b/arch/arm/include/asm/arch-fsl-layerscape/immap_lsch2.h
@@ -650,6 +650,7 @@  struct ccsr_serdes {
 	u8	res_19a0[0x2000-0x19a0];	/* from 0x19a0 to 0x1fff */
 };
 
+#ifndef CONFIG_MPC8XXX_GPIO
 struct ccsr_gpio {
 	u32	gpdir;
 	u32	gpodr;
@@ -659,6 +660,7 @@  struct ccsr_gpio {
 	u32	gpicr;
 	u32	gpibe;
 };
+#endif
 
 /* MMU 500 */
 #define SMMU_SCR0			(SMMU_BASE + 0x0)
diff --git a/arch/arm/include/asm/arch-ls102xa/gpio.h b/arch/arm/include/asm/arch-ls102xa/gpio.h
index dad181e..63afb7f 100644
--- a/arch/arm/include/asm/arch-ls102xa/gpio.h
+++ b/arch/arm/include/asm/arch-ls102xa/gpio.h
@@ -13,4 +13,10 @@ 
 #ifndef __ASM_ARCH_LS102XA_GPIO_H_
 #define __ASM_ARCH_LS102XA_GPIO_H_
 
+struct mpc8xxx_gpio_plat {
+	ulong addr;
+	unsigned long size;
+	uint ngpios;
+};
+
 #endif
diff --git a/drivers/gpio/mpc8xxx_gpio.c b/drivers/gpio/mpc8xxx_gpio.c
index c273c2c..50d372c 100644
--- a/drivers/gpio/mpc8xxx_gpio.c
+++ b/drivers/gpio/mpc8xxx_gpio.c
@@ -12,6 +12,7 @@ 
 #include <dm.h>
 #include <mapmem.h>
 #include <asm/gpio.h>
+#include <asm/io.h>
 
 struct ccsr_gpio {
 	u32	gpdir;