diff mbox

[U-Boot,1/2] arm: ls102xa: Add dummy gpio.h to enable CONFIG_OF_CONTROL

Message ID 1418192223-3899-1-git-send-email-ruchika.gupta@freescale.com
State Accepted
Delegated to: York Sun
Headers show

Commit Message

Ruchika Gupta Dec. 10, 2014, 6:17 a.m. UTC
If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled.
It includes <asm/gpio.h> and then <asm/gpio.h> includes
<asm/arch/gpio.h>.  As a result, all the SoCs that enable
CONFIG_OF_CONTROL must have <asm/arch/gpio.h> even if they
do not support GPIO.

The right fix would be to split the lib/fdtdec.c to remove
dependency on GPIO.This commit adds a dummy <asm/arch/gpio.h>
to support OF_CONTROL for LS102x platform. This dummy header
will be removed after FDT-GPIO stuff is fixed correctly.

Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
---
 arch/arm/include/asm/arch-ls102xa/gpio.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 create mode 100644 arch/arm/include/asm/arch-ls102xa/gpio.h

Comments

Masahiro Yamada Dec. 10, 2014, 7:50 a.m. UTC | #1
On Wed, 10 Dec 2014 11:47:03 +0530
Ruchika Gupta <ruchika.gupta@freescale.com> wrote:

> If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled.
> It includes <asm/gpio.h> and then <asm/gpio.h> includes
> <asm/arch/gpio.h>.  As a result, all the SoCs that enable
> CONFIG_OF_CONTROL must have <asm/arch/gpio.h> even if they
> do not support GPIO.
> 
> The right fix would be to split the lib/fdtdec.c to remove
> dependency on GPIO.This commit adds a dummy <asm/arch/gpio.h>
> to support OF_CONTROL for LS102x platform. This dummy header
> will be removed after FDT-GPIO stuff is fixed correctly.
> 
> Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
> ---

Oh, you too.

(I assume you saw my commit 630bf80ebb34.)


When I try to do something on my board,
I pretty often encounter awful code.

To fix that crap, I have to fix other crap first,
which requires me to fix other crap in advance...
My plate gets filled with a bunch of issues soon.

I am getting sick of this project.


Best Regards
Masahiro Yamada
Simon Glass Dec. 15, 2014, 2:40 p.m. UTC | #2
Hi,

On 10 December 2014 at 00:50, Masahiro Yamada <yamada.m@jp.panasonic.com> wrote:
>
> On Wed, 10 Dec 2014 11:47:03 +0530
> Ruchika Gupta <ruchika.gupta@freescale.com> wrote:
>
>> If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled.
>> It includes <asm/gpio.h> and then <asm/gpio.h> includes
>> <asm/arch/gpio.h>.  As a result, all the SoCs that enable
>> CONFIG_OF_CONTROL must have <asm/arch/gpio.h> even if they
>> do not support GPIO.
>>
>> The right fix would be to split the lib/fdtdec.c to remove
>> dependency on GPIO.This commit adds a dummy <asm/arch/gpio.h>
>> to support OF_CONTROL for LS102x platform. This dummy header
>> will be removed after FDT-GPIO stuff is fixed correctly.
>>
>> Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
>> ---
>
> Oh, you too.
>
> (I assume you saw my commit 630bf80ebb34.)

This was discussed here:

http://patchwork.ozlabs.org/patch/415036/

These GPIO functions in fdtdec.c are currently only used on Tegra and
Exynos. They are not correctly implemented and we really need to
remove them in favour of proper ones in the uclass. Both of these
platforms fully support driver model so this should not be hard.

However this is the third case of hitting this problem. Let's say that
if we don't manage to remove this code by the the end of this year
then we can go ahead and split this out as Masahiro and you suggest.
It seems hard to remove old code sometimes.

[snip]

Regards,
Simon
York Sun Jan. 24, 2015, 3:01 p.m. UTC | #3
On 12/10/2014 12:17 AM, Ruchika Gupta wrote:
> If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled.
> It includes <asm/gpio.h> and then <asm/gpio.h> includes
> <asm/arch/gpio.h>.  As a result, all the SoCs that enable
> CONFIG_OF_CONTROL must have <asm/arch/gpio.h> even if they
> do not support GPIO.
> 
> The right fix would be to split the lib/fdtdec.c to remove
> dependency on GPIO.This commit adds a dummy <asm/arch/gpio.h>
> to support OF_CONTROL for LS102x platform. This dummy header
> will be removed after FDT-GPIO stuff is fixed correctly.
> 
> Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
> ---

Applied to u-boot-fsl-qoriq master branch, awaiting upstream.

York
diff mbox

Patch

diff --git a/arch/arm/include/asm/arch-ls102xa/gpio.h b/arch/arm/include/asm/arch-ls102xa/gpio.h
new file mode 100644
index 0000000..b704436
--- /dev/null
+++ b/arch/arm/include/asm/arch-ls102xa/gpio.h
@@ -0,0 +1,15 @@ 
+/*
+ * SPDX-License-Identifier:	GPL-2.0+
+ */
+
+/*
+ * Dummy header file to enable CONFIG_OF_CONTROL.
+ * If CONFIG_OF_CONTROL is enabled, lib/fdtdec.c is compiled.
+ * It includes <asm/arch/gpio.h> via <asm/gpio.h>, so those SoCs that enable
+ * OF_CONTROL must have arch/gpio.h.
+ */
+
+#ifndef __ASM_ARCH_LS102XA_GPIO_H_
+#define __ASM_ARCH_LS102XA_GPIO_H_
+
+#endif