diff mbox series

ARM: uniphier: delete or replace <common.h> includes

Message ID 20200507130952.1360827-1-yamada.masahiro@socionext.com
State Superseded
Delegated to: Masahiro Yamada
Headers show
Series ARM: uniphier: delete or replace <common.h> includes | expand

Commit Message

Masahiro Yamada May 7, 2020, 1:09 p.m. UTC
<common.h> pulls in a lot of bloat. <common.h> is unneeded in most of
places.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
---

 arch/arm/mach-uniphier/arm32/cache-uniphier.c         | 1 -
 arch/arm/mach-uniphier/arm32/psci.c                   | 1 -
 arch/arm/mach-uniphier/arm32/timer.c                  | 2 +-
 arch/arm/mach-uniphier/arm64/mem_map.c                | 1 -
 arch/arm/mach-uniphier/base-address.c                 | 2 +-
 arch/arm/mach-uniphier/board_late_init.c              | 1 -
 arch/arm/mach-uniphier/boards.c                       | 2 +-
 arch/arm/mach-uniphier/boot-device/boot-device-ld11.c | 1 -
 arch/arm/mach-uniphier/boot-device/boot-device-ld4.c  | 1 -
 arch/arm/mach-uniphier/boot-device/boot-device-pro5.c | 1 -
 arch/arm/mach-uniphier/boot-device/boot-device-pxs2.c | 1 -
 arch/arm/mach-uniphier/boot-device/boot-device-pxs3.c | 2 +-
 arch/arm/mach-uniphier/boot-device/boot-device.c      | 4 +++-
 arch/arm/mach-uniphier/clk/clk-dram-ld4.c             | 1 -
 arch/arm/mach-uniphier/clk/clk-dram-pxs2.c            | 1 -
 arch/arm/mach-uniphier/clk/clk-early-ld4.c            | 1 -
 arch/arm/mach-uniphier/clk/clk-ld11.c                 | 2 +-
 arch/arm/mach-uniphier/clk/dpll-ld4.c                 | 2 +-
 arch/arm/mach-uniphier/clk/dpll-pro4.c                | 2 +-
 arch/arm/mach-uniphier/debug-uart/debug-uart.c        | 1 -
 arch/arm/mach-uniphier/dram/cmd_ddrmphy.c             | 3 +--
 arch/arm/mach-uniphier/dram/cmd_ddrphy.c              | 2 +-
 arch/arm/mach-uniphier/dram/umc-ld4.c                 | 1 -
 arch/arm/mach-uniphier/dram/umc-pro4.c                | 1 -
 arch/arm/mach-uniphier/dram/umc-sld8.c                | 1 -
 arch/arm/mach-uniphier/dram_init.c                    | 2 +-
 arch/arm/mach-uniphier/fdt-fixup.c                    | 2 +-
 arch/arm/mach-uniphier/init.h                         | 1 +
 arch/arm/mach-uniphier/memconf.c                      | 1 -
 arch/arm/mach-uniphier/micro-support-card.c           | 3 ++-
 arch/arm/mach-uniphier/mmc-boot-mode.c                | 1 -
 arch/arm/mach-uniphier/mmc-first-dev.c                | 2 +-
 arch/arm/mach-uniphier/pinctrl-glue.c                 | 1 -
 arch/arm/mach-uniphier/reset.c                        | 1 -
 arch/arm/mach-uniphier/sbc/sbc-ld11.c                 | 1 -
 arch/arm/mach-uniphier/sbc/sbc.c                      | 1 -
 arch/arm/mach-uniphier/spl_board_init.c               | 1 -
 37 files changed, 18 insertions(+), 37 deletions(-)

Comments

Simon Glass May 8, 2020, 1:36 a.m. UTC | #1
Hi Masahiro,

On Thu, 7 May 2020 at 07:10, Masahiro Yamada
<yamada.masahiro@socionext.com> wrote:
>
> <common.h> pulls in a lot of bloat. <common.h> is unneeded in most of
> places.
>
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
>
>  arch/arm/mach-uniphier/arm32/cache-uniphier.c         | 1 -
>  arch/arm/mach-uniphier/arm32/psci.c                   | 1 -
>  arch/arm/mach-uniphier/arm32/timer.c                  | 2 +-
>  arch/arm/mach-uniphier/arm64/mem_map.c                | 1 -
>  arch/arm/mach-uniphier/base-address.c                 | 2 +-
>  arch/arm/mach-uniphier/board_late_init.c              | 1 -
>  arch/arm/mach-uniphier/boards.c                       | 2 +-
>  arch/arm/mach-uniphier/boot-device/boot-device-ld11.c | 1 -
>  arch/arm/mach-uniphier/boot-device/boot-device-ld4.c  | 1 -
>  arch/arm/mach-uniphier/boot-device/boot-device-pro5.c | 1 -
>  arch/arm/mach-uniphier/boot-device/boot-device-pxs2.c | 1 -
>  arch/arm/mach-uniphier/boot-device/boot-device-pxs3.c | 2 +-
>  arch/arm/mach-uniphier/boot-device/boot-device.c      | 4 +++-
>  arch/arm/mach-uniphier/clk/clk-dram-ld4.c             | 1 -
>  arch/arm/mach-uniphier/clk/clk-dram-pxs2.c            | 1 -
>  arch/arm/mach-uniphier/clk/clk-early-ld4.c            | 1 -
>  arch/arm/mach-uniphier/clk/clk-ld11.c                 | 2 +-
>  arch/arm/mach-uniphier/clk/dpll-ld4.c                 | 2 +-
>  arch/arm/mach-uniphier/clk/dpll-pro4.c                | 2 +-
>  arch/arm/mach-uniphier/debug-uart/debug-uart.c        | 1 -
>  arch/arm/mach-uniphier/dram/cmd_ddrmphy.c             | 3 +--
>  arch/arm/mach-uniphier/dram/cmd_ddrphy.c              | 2 +-
>  arch/arm/mach-uniphier/dram/umc-ld4.c                 | 1 -
>  arch/arm/mach-uniphier/dram/umc-pro4.c                | 1 -
>  arch/arm/mach-uniphier/dram/umc-sld8.c                | 1 -
>  arch/arm/mach-uniphier/dram_init.c                    | 2 +-
>  arch/arm/mach-uniphier/fdt-fixup.c                    | 2 +-
>  arch/arm/mach-uniphier/init.h                         | 1 +
>  arch/arm/mach-uniphier/memconf.c                      | 1 -
>  arch/arm/mach-uniphier/micro-support-card.c           | 3 ++-
>  arch/arm/mach-uniphier/mmc-boot-mode.c                | 1 -
>  arch/arm/mach-uniphier/mmc-first-dev.c                | 2 +-
>  arch/arm/mach-uniphier/pinctrl-glue.c                 | 1 -
>  arch/arm/mach-uniphier/reset.c                        | 1 -
>  arch/arm/mach-uniphier/sbc/sbc-ld11.c                 | 1 -
>  arch/arm/mach-uniphier/sbc/sbc.c                      | 1 -
>  arch/arm/mach-uniphier/spl_board_init.c               | 1 -
>  37 files changed, 18 insertions(+), 37 deletions(-)
>

I'm wary of this. I think that every file should include common.h and
the solution is to remove the bloat. I have been plugging away at
that. There is a pending series that reduces it down further, to 14
includes. Please help review!

http://patchwork.ozlabs.org/project/uboot/list/?series=169491

The problem is that when someone uses #ifdef CONFIG options the
config.h has to be included. So your patch is a bit brittle. As soon
as someone uses CONFIG it may break.

Anyway this is uniphier code so it's up to you.

Regards,
Simon
Masahiro Yamada May 8, 2020, 2:30 a.m. UTC | #2
Hi Simon,


On Fri, May 8, 2020 at 10:37 AM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Masahiro,
>
> On Thu, 7 May 2020 at 07:10, Masahiro Yamada
> <yamada.masahiro@socionext.com> wrote:
> >
> > <common.h> pulls in a lot of bloat. <common.h> is unneeded in most of
> > places.
> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> >
>
> I'm wary of this. I think that every file should include common.h


I disagree.

"Please include <common.h> at the beginning of every file"
is a fragile rule.
You have no way to check it.

Our goal is to get rid of the
special treatment of <common.h>



> and
> the solution is to remove the bloat. I have been plugging away at
> that. There is a pending series that reduces it down further, to 14
> includes. Please help review!
>
> http://patchwork.ozlabs.org/project/uboot/list/?series=169491

I saw it.

Humans cannot check it.
If buildman does not raise a flag, it is fine.



>
> The problem is that when someone uses #ifdef CONFIG options the
> config.h has to be included. So your patch is a bit brittle. As soon
> as someone uses CONFIG it may break.


For the legacy CONFIG options, yes.
The options in Kconfig are all safe.

Common options were mostly moved to Kconfig.

We still have lots in scripts/config_whitelist.txt
but most of them are platform-specific craps.




> Anyway this is uniphier code so it's up to you.
>
> Regards,
> Simon



--
Best Regards
Masahiro Yamada
Simon Glass May 8, 2020, 2:40 a.m. UTC | #3
Hi Masahiro,

On Thu, 7 May 2020 at 20:31, Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Hi Simon,
>
>
> On Fri, May 8, 2020 at 10:37 AM Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Masahiro,
> >
> > On Thu, 7 May 2020 at 07:10, Masahiro Yamada
> > <yamada.masahiro@socionext.com> wrote:
> > >
> > > <common.h> pulls in a lot of bloat. <common.h> is unneeded in most of
> > > places.
> > >
> > > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > > ---
> > >
> > >
> >
> > I'm wary of this. I think that every file should include common.h
>
>
> I disagree.
>
> "Please include <common.h> at the beginning of every file"
> is a fragile rule.
> You have no way to check it.

We can add it to checkpatch.

>
> Our goal is to get rid of the
> special treatment of <common.h>

As we get closer though I've been thinking about the goal. Do we want
people to include config.h specifically if common.h has nothing in it?
I feel it is safer to keep common.h, perhaps just with config.h
included, until we fully understand what we need.

>
>
>
> > and
> > the solution is to remove the bloat. I have been plugging away at
> > that. There is a pending series that reduces it down further, to 14
> > includes. Please help review!
> >
> > http://patchwork.ozlabs.org/project/uboot/list/?series=169491
>
> I saw it.
>
> Humans cannot check it.
> If buildman does not raise a flag, it is fine.

OK.

>
>
>
> >
> > The problem is that when someone uses #ifdef CONFIG options the
> > config.h has to be included. So your patch is a bit brittle. As soon
> > as someone uses CONFIG it may break.
>
>
> For the legacy CONFIG options, yes.
> The options in Kconfig are all safe.

How come? If config.h is included, the options are not defined.

>
> Common options were mostly moved to Kconfig.
>
> We still have lots in scripts/config_whitelist.txt
> but most of them are platform-specific craps.

Yes...perhaps we should try to have two whitelists, so we know which
ones matter more.

Regards,
Simon
Masahiro Yamada May 8, 2020, 7:37 a.m. UTC | #4
On Fri, May 8, 2020 at 11:41 AM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Masahiro,
>
> On Thu, 7 May 2020 at 20:31, Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > Hi Simon,
> >
> >
> > On Fri, May 8, 2020 at 10:37 AM Simon Glass <sjg@chromium.org> wrote:
> > >
> > > Hi Masahiro,
> > >
> > > On Thu, 7 May 2020 at 07:10, Masahiro Yamada
> > > <yamada.masahiro@socionext.com> wrote:
> > > >
> > > > <common.h> pulls in a lot of bloat. <common.h> is unneeded in most of
> > > > places.
> > > >
> > > > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > > > ---
> > > >
> > > >
> > >
> > > I'm wary of this. I think that every file should include common.h
> >
> >
> > I disagree.
> >
> > "Please include <common.h> at the beginning of every file"
> > is a fragile rule.
> > You have no way to check it.
>
> We can add it to checkpatch.


checkpatch is weak since not all people run it.



> >
> > Our goal is to get rid of the
> > special treatment of <common.h>
>
> As we get closer though I've been thinking about the goal. Do we want
> people to include config.h specifically if common.h has nothing in it?

Yes and no.

In theory, if we succeed in converting all CONFIG options
to Kconfig, config.h will go away. But we are still
much far from the goal.

Maybe, we should give '-include include/config.h' from the
command line as we do '-include include/linux/kconfig.h'.


> I feel it is safer to keep common.h, perhaps just with config.h
> included, until we fully understand what we need.
>
> >
> >
> >
> > > and
> > > the solution is to remove the bloat. I have been plugging away at
> > > that. There is a pending series that reduces it down further, to 14
> > > includes. Please help review!
> > >
> > > http://patchwork.ozlabs.org/project/uboot/list/?series=169491
> >
> > I saw it.
> >
> > Humans cannot check it.
> > If buildman does not raise a flag, it is fine.
>
> OK.
>
> >
> >
> >
> > >
> > > The problem is that when someone uses #ifdef CONFIG options the
> > > config.h has to be included. So your patch is a bit brittle. As soon
> > > as someone uses CONFIG it may break.
> >
> >
> > For the legacy CONFIG options, yes.
> > The options in Kconfig are all safe.
>
> How come? If config.h is included, the options are not defined.


The top Makefile forces every file to include
include/linux/kconfig.h, which includes
include/generated/autoconf.h

So, CONFIG options from Kconfig are automatically included.

This does not happen for legacy CONFIG options
in include/configs/*.h


> >
> > Common options were mostly moved to Kconfig.
> >
> > We still have lots in scripts/config_whitelist.txt
> > but most of them are platform-specific craps.
>
> Yes...perhaps we should try to have two whitelists, so we know which
> ones matter more.


I do not think so.
The criteria between the two whitelists
is ambiguous.
We should not do what we cannot do perfectly.



--
Best Regards
Masahiro Yamada
Simon Glass May 8, 2020, 6:33 p.m. UTC | #5
Hi Masahiro,

On Fri, 8 May 2020 at 01:38, Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Fri, May 8, 2020 at 11:41 AM Simon Glass <sjg@chromium.org> wrote:
> >
> > Hi Masahiro,
> >
> > On Thu, 7 May 2020 at 20:31, Masahiro Yamada <masahiroy@kernel.org> wrote:
> > >
> > > Hi Simon,
> > >
> > >
> > > On Fri, May 8, 2020 at 10:37 AM Simon Glass <sjg@chromium.org> wrote:
> > > >
> > > > Hi Masahiro,
> > > >
> > > > On Thu, 7 May 2020 at 07:10, Masahiro Yamada
> > > > <yamada.masahiro@socionext.com> wrote:
> > > > >
> > > > > <common.h> pulls in a lot of bloat. <common.h> is unneeded in most of
> > > > > places.
> > > > >
> > > > > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > > > > ---
> > > > >
> > > > >
> > > >
> > > > I'm wary of this. I think that every file should include common.h
> > >
> > >
> > > I disagree.
> > >
> > > "Please include <common.h> at the beginning of every file"
> > > is a fragile rule.
> > > You have no way to check it.
> >
> > We can add it to checkpatch.
>
>
> checkpatch is weak since not all people run it.

They should! In fact I think we should ask people to run patman since
it does a better job with maintainers for each patch.

>
>
>
> > >
> > > Our goal is to get rid of the
> > > special treatment of <common.h>
> >
> > As we get closer though I've been thinking about the goal. Do we want
> > people to include config.h specifically if common.h has nothing in it?
>
> Yes and no.
>
> In theory, if we succeed in converting all CONFIG options
> to Kconfig, config.h will go away. But we are still
> much far from the goal.
>
> Maybe, we should give '-include include/config.h' from the
> command line as we do '-include include/linux/kconfig.h'.

Given that we are getting rid of the old CONFIG we should probably not do that.

>
>
> > I feel it is safer to keep common.h, perhaps just with config.h
> > included, until we fully understand what we need.
> >
> > >
> > >
> > >
> > > > and
> > > > the solution is to remove the bloat. I have been plugging away at
> > > > that. There is a pending series that reduces it down further, to 14
> > > > includes. Please help review!
> > > >
> > > > http://patchwork.ozlabs.org/project/uboot/list/?series=169491
> > >
> > > I saw it.
> > >
> > > Humans cannot check it.
> > > If buildman does not raise a flag, it is fine.
> >
> > OK.
> >
> > >
> > >
> > >
> > > >
> > > > The problem is that when someone uses #ifdef CONFIG options the
> > > > config.h has to be included. So your patch is a bit brittle. As soon
> > > > as someone uses CONFIG it may break.
> > >
> > >
> > > For the legacy CONFIG options, yes.
> > > The options in Kconfig are all safe.
> >
> > How come? If config.h is included, the options are not defined.
>
>
> The top Makefile forces every file to include
> include/linux/kconfig.h, which includes
> include/generated/autoconf.h
>
> So, CONFIG options from Kconfig are automatically included.
>
> This does not happen for legacy CONFIG options
> in include/configs/*.h

OK I see. If I knew that once I forgot it.

>
>
> > >
> > > Common options were mostly moved to Kconfig.
> > >
> > > We still have lots in scripts/config_whitelist.txt
> > > but most of them are platform-specific craps.
> >
> > Yes...perhaps we should try to have two whitelists, so we know which
> > ones matter more.
>
>
> I do not think so.
> The criteria between the two whitelists
> is ambiguous.
> We should not do what we cannot do perfectly.

Yes it is hard. I was thinking of splitting them by if they are
referenced in common files (i.e. not just board/ and arch/).

Regards,
Simon
diff mbox series

Patch

diff --git a/arch/arm/mach-uniphier/arm32/cache-uniphier.c b/arch/arm/mach-uniphier/arm32/cache-uniphier.c
index b6e4abbad0..cde2a8124f 100644
--- a/arch/arm/mach-uniphier/arm32/cache-uniphier.c
+++ b/arch/arm/mach-uniphier/arm32/cache-uniphier.c
@@ -5,7 +5,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <cpu_func.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
diff --git a/arch/arm/mach-uniphier/arm32/psci.c b/arch/arm/mach-uniphier/arm32/psci.c
index 9a3793316a..70d9cfd506 100644
--- a/arch/arm/mach-uniphier/arm32/psci.c
+++ b/arch/arm/mach-uniphier/arm32/psci.c
@@ -4,7 +4,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <cpu_func.h>
 #include <linux/bitops.h>
 #include <linux/delay.h>
diff --git a/arch/arm/mach-uniphier/arm32/timer.c b/arch/arm/mach-uniphier/arm32/timer.c
index 899b539104..5878b78eaa 100644
--- a/arch/arm/mach-uniphier/arm32/timer.c
+++ b/arch/arm/mach-uniphier/arm32/timer.c
@@ -3,7 +3,7 @@ 
  * Copyright (C) 2012-2015 Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
+#include <config.h>
 #include <linux/io.h>
 
 #include "arm-mpcore.h"
diff --git a/arch/arm/mach-uniphier/arm64/mem_map.c b/arch/arm/mach-uniphier/arm64/mem_map.c
index 7653bd2d3c..a8bd4eee89 100644
--- a/arch/arm/mach-uniphier/arm64/mem_map.c
+++ b/arch/arm/mach-uniphier/arm64/mem_map.c
@@ -3,7 +3,6 @@ 
  * Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <linux/types.h>
 #include <asm/armv8/mmu.h>
 
diff --git a/arch/arm/mach-uniphier/base-address.c b/arch/arm/mach-uniphier/base-address.c
index 5ee742e363..d7456f8df6 100644
--- a/arch/arm/mach-uniphier/base-address.c
+++ b/arch/arm/mach-uniphier/base-address.c
@@ -3,9 +3,9 @@ 
 // Copyright (C) 2019 Socionext Inc.
 //   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
 
-#include <common.h>
 #include <dm/of.h>
 #include <fdt_support.h>
+#include <linux/errno.h>
 #include <linux/io.h>
 #include <linux/libfdt.h>
 #include <linux/sizes.h>
diff --git a/arch/arm/mach-uniphier/board_late_init.c b/arch/arm/mach-uniphier/board_late_init.c
index 378aad0c9c..b800e8b8c6 100644
--- a/arch/arm/mach-uniphier/board_late_init.c
+++ b/arch/arm/mach-uniphier/board_late_init.c
@@ -5,7 +5,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <env.h>
 #include <init.h>
 #include <spl.h>
diff --git a/arch/arm/mach-uniphier/boards.c b/arch/arm/mach-uniphier/boards.c
index d9a8d2f28a..3e2ec9b26a 100644
--- a/arch/arm/mach-uniphier/boards.c
+++ b/arch/arm/mach-uniphier/boards.c
@@ -4,9 +4,9 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <linux/libfdt.h>
 #include <linux/kernel.h>
+#include <asm/global_data.h>
 
 #include "init.h"
 
diff --git a/arch/arm/mach-uniphier/boot-device/boot-device-ld11.c b/arch/arm/mach-uniphier/boot-device/boot-device-ld11.c
index 11e70a926f..4689ed79fd 100644
--- a/arch/arm/mach-uniphier/boot-device/boot-device-ld11.c
+++ b/arch/arm/mach-uniphier/boot-device/boot-device-ld11.c
@@ -4,7 +4,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <spl.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
diff --git a/arch/arm/mach-uniphier/boot-device/boot-device-ld4.c b/arch/arm/mach-uniphier/boot-device/boot-device-ld4.c
index 02b239475f..c6aef18c19 100644
--- a/arch/arm/mach-uniphier/boot-device/boot-device-ld4.c
+++ b/arch/arm/mach-uniphier/boot-device/boot-device-ld4.c
@@ -5,7 +5,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <spl.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
diff --git a/arch/arm/mach-uniphier/boot-device/boot-device-pro5.c b/arch/arm/mach-uniphier/boot-device/boot-device-pro5.c
index 55452484d9..efd07a3296 100644
--- a/arch/arm/mach-uniphier/boot-device/boot-device-pro5.c
+++ b/arch/arm/mach-uniphier/boot-device/boot-device-pro5.c
@@ -4,7 +4,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <spl.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
diff --git a/arch/arm/mach-uniphier/boot-device/boot-device-pxs2.c b/arch/arm/mach-uniphier/boot-device/boot-device-pxs2.c
index 49c5da1469..677470cdc6 100644
--- a/arch/arm/mach-uniphier/boot-device/boot-device-pxs2.c
+++ b/arch/arm/mach-uniphier/boot-device/boot-device-pxs2.c
@@ -4,7 +4,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <spl.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
diff --git a/arch/arm/mach-uniphier/boot-device/boot-device-pxs3.c b/arch/arm/mach-uniphier/boot-device/boot-device-pxs3.c
index 2edf66d5c1..6888099312 100644
--- a/arch/arm/mach-uniphier/boot-device/boot-device-pxs3.c
+++ b/arch/arm/mach-uniphier/boot-device/boot-device-pxs3.c
@@ -4,8 +4,8 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <spl.h>
+#include <linux/bitops.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
 
diff --git a/arch/arm/mach-uniphier/boot-device/boot-device.c b/arch/arm/mach-uniphier/boot-device/boot-device.c
index 83f8c6a428..927e5fce2b 100644
--- a/arch/arm/mach-uniphier/boot-device/boot-device.c
+++ b/arch/arm/mach-uniphier/boot-device/boot-device.c
@@ -4,9 +4,11 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
+#include <command.h>
 #include <spl.h>
 #include <stdio.h>
+#include <linux/bug.h>
+#include <linux/errno.h>
 #include <linux/io.h>
 #include <linux/log2.h>
 
diff --git a/arch/arm/mach-uniphier/clk/clk-dram-ld4.c b/arch/arm/mach-uniphier/clk/clk-dram-ld4.c
index c796d364bb..3b721eaf23 100644
--- a/arch/arm/mach-uniphier/clk/clk-dram-ld4.c
+++ b/arch/arm/mach-uniphier/clk/clk-dram-ld4.c
@@ -4,7 +4,6 @@ 
  * Copyright (C) 2015-2017 Socionext Inc.
  */
 
-#include <common.h>
 #include <spl.h>
 #include <linux/io.h>
 
diff --git a/arch/arm/mach-uniphier/clk/clk-dram-pxs2.c b/arch/arm/mach-uniphier/clk/clk-dram-pxs2.c
index b78bd01672..75d3e70d6a 100644
--- a/arch/arm/mach-uniphier/clk/clk-dram-pxs2.c
+++ b/arch/arm/mach-uniphier/clk/clk-dram-pxs2.c
@@ -3,7 +3,6 @@ 
  * Copyright (C) 2016-2017 Socionext Inc.
  */
 
-#include <common.h>
 #include <spl.h>
 #include <linux/io.h>
 
diff --git a/arch/arm/mach-uniphier/clk/clk-early-ld4.c b/arch/arm/mach-uniphier/clk/clk-early-ld4.c
index 0f9ce65097..25b72d8926 100644
--- a/arch/arm/mach-uniphier/clk/clk-early-ld4.c
+++ b/arch/arm/mach-uniphier/clk/clk-early-ld4.c
@@ -4,7 +4,6 @@ 
  * Copyright (C) 2015-2017 Socionext Inc.
  */
 
-#include <common.h>
 #include <spl.h>
 #include <linux/io.h>
 
diff --git a/arch/arm/mach-uniphier/clk/clk-ld11.c b/arch/arm/mach-uniphier/clk/clk-ld11.c
index 0917b33c25..d241a65382 100644
--- a/arch/arm/mach-uniphier/clk/clk-ld11.c
+++ b/arch/arm/mach-uniphier/clk/clk-ld11.c
@@ -3,9 +3,9 @@ 
  * Copyright (C) 2016 Socionext Inc.
  */
 
-#include <common.h>
 #include <spl.h>
 #include <linux/bitops.h>
+#include <linux/delay.h>
 #include <linux/io.h>
 
 #include "../init.h"
diff --git a/arch/arm/mach-uniphier/clk/dpll-ld4.c b/arch/arm/mach-uniphier/clk/dpll-ld4.c
index 72fe8db8dd..3ccaf02242 100644
--- a/arch/arm/mach-uniphier/clk/dpll-ld4.c
+++ b/arch/arm/mach-uniphier/clk/dpll-ld4.c
@@ -4,7 +4,7 @@ 
  * Copyright (C) 2015-2016 Socionext Inc.
  */
 
-#include <common.h>
+#include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/io.h>
 
diff --git a/arch/arm/mach-uniphier/clk/dpll-pro4.c b/arch/arm/mach-uniphier/clk/dpll-pro4.c
index 6259495484..44006ae6dc 100644
--- a/arch/arm/mach-uniphier/clk/dpll-pro4.c
+++ b/arch/arm/mach-uniphier/clk/dpll-pro4.c
@@ -4,7 +4,7 @@ 
  * Copyright (C) 2015-2016 Socionext Inc.
  */
 
-#include <common.h>
+#include <linux/delay.h>
 #include <linux/errno.h>
 #include <linux/io.h>
 
diff --git a/arch/arm/mach-uniphier/debug-uart/debug-uart.c b/arch/arm/mach-uniphier/debug-uart/debug-uart.c
index a70ce59acc..d116d46812 100644
--- a/arch/arm/mach-uniphier/debug-uart/debug-uart.c
+++ b/arch/arm/mach-uniphier/debug-uart/debug-uart.c
@@ -3,7 +3,6 @@ 
  * Copyright (C) 2016 Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <debug_uart.h>
 #include <linux/io.h>
 #include <linux/serial_reg.h>
diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
index 9a25bba599..a6c24f2f83 100644
--- a/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
+++ b/arch/arm/mach-uniphier/dram/cmd_ddrmphy.c
@@ -4,8 +4,7 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
-#include <stdio.h>
+#include <command.h>
 #include <linux/io.h>
 #include <linux/printk.h>
 #include <linux/sizes.h>
diff --git a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
index a616a2aafb..dcf7e752ef 100644
--- a/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
+++ b/arch/arm/mach-uniphier/dram/cmd_ddrphy.c
@@ -5,7 +5,7 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
+#include <command.h>
 #include <stdio.h>
 #include <linux/io.h>
 #include <linux/printk.h>
diff --git a/arch/arm/mach-uniphier/dram/umc-ld4.c b/arch/arm/mach-uniphier/dram/umc-ld4.c
index 2d1f3e3dc0..96acca2562 100644
--- a/arch/arm/mach-uniphier/dram/umc-ld4.c
+++ b/arch/arm/mach-uniphier/dram/umc-ld4.c
@@ -5,7 +5,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <linux/errno.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
diff --git a/arch/arm/mach-uniphier/dram/umc-pro4.c b/arch/arm/mach-uniphier/dram/umc-pro4.c
index 012e5f869b..cde39b499b 100644
--- a/arch/arm/mach-uniphier/dram/umc-pro4.c
+++ b/arch/arm/mach-uniphier/dram/umc-pro4.c
@@ -5,7 +5,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <linux/errno.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
diff --git a/arch/arm/mach-uniphier/dram/umc-sld8.c b/arch/arm/mach-uniphier/dram/umc-sld8.c
index b55b04415c..a11586952d 100644
--- a/arch/arm/mach-uniphier/dram/umc-sld8.c
+++ b/arch/arm/mach-uniphier/dram/umc-sld8.c
@@ -5,7 +5,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <linux/errno.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
diff --git a/arch/arm/mach-uniphier/dram_init.c b/arch/arm/mach-uniphier/dram_init.c
index 5f9d90fe6d..06208a9525 100644
--- a/arch/arm/mach-uniphier/dram_init.c
+++ b/arch/arm/mach-uniphier/dram_init.c
@@ -5,13 +5,13 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <linux/errno.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/printk.h>
 #include <linux/sizes.h>
 #include <asm/global_data.h>
+#include <asm/u-boot.h>
 
 #include "init.h"
 #include "sg-regs.h"
diff --git a/arch/arm/mach-uniphier/fdt-fixup.c b/arch/arm/mach-uniphier/fdt-fixup.c
index 6f3c29d8c0..980c260f4c 100644
--- a/arch/arm/mach-uniphier/fdt-fixup.c
+++ b/arch/arm/mach-uniphier/fdt-fixup.c
@@ -4,11 +4,11 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <fdt_support.h>
 #include <fdtdec.h>
 #include <jffs2/load_kernel.h>
 #include <mtd_node.h>
+#include <linux/errno.h>
 #include <linux/kernel.h>
 #include <linux/printk.h>
 
diff --git a/arch/arm/mach-uniphier/init.h b/arch/arm/mach-uniphier/init.h
index 3c77f48853..e0b931ed80 100644
--- a/arch/arm/mach-uniphier/init.h
+++ b/arch/arm/mach-uniphier/init.h
@@ -8,6 +8,7 @@ 
 #define __MACH_INIT_H
 
 #include <linux/types.h>
+#include <linux/bitops.h>
 
 #define UNIPHIER_MAX_NR_DRAM_CH		3
 
diff --git a/arch/arm/mach-uniphier/memconf.c b/arch/arm/mach-uniphier/memconf.c
index f69b489b76..57192f0154 100644
--- a/arch/arm/mach-uniphier/memconf.c
+++ b/arch/arm/mach-uniphier/memconf.c
@@ -5,7 +5,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <linux/errno.h>
 #include <linux/io.h>
 #include <linux/sizes.h>
diff --git a/arch/arm/mach-uniphier/micro-support-card.c b/arch/arm/mach-uniphier/micro-support-card.c
index c71470a204..78f54d654b 100644
--- a/arch/arm/mach-uniphier/micro-support-card.c
+++ b/arch/arm/mach-uniphier/micro-support-card.c
@@ -5,11 +5,12 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <dm/of.h>
 #include <fdt_support.h>
 #include <linux/ctype.h>
+#include <linux/delay.h>
 #include <linux/io.h>
+#include <asm/global_data.h>
 
 #include "micro-support-card.h"
 
diff --git a/arch/arm/mach-uniphier/mmc-boot-mode.c b/arch/arm/mach-uniphier/mmc-boot-mode.c
index b48495365c..e47e5df648 100644
--- a/arch/arm/mach-uniphier/mmc-boot-mode.c
+++ b/arch/arm/mach-uniphier/mmc-boot-mode.c
@@ -4,7 +4,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <mmc.h>
 #include <spl.h>
 
diff --git a/arch/arm/mach-uniphier/mmc-first-dev.c b/arch/arm/mach-uniphier/mmc-first-dev.c
index e2f4f4eb5c..31e5da6950 100644
--- a/arch/arm/mach-uniphier/mmc-first-dev.c
+++ b/arch/arm/mach-uniphier/mmc-first-dev.c
@@ -4,7 +4,7 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
+#include <command.h>
 #include <env.h>
 #include <mmc.h>
 #include <linux/errno.h>
diff --git a/arch/arm/mach-uniphier/pinctrl-glue.c b/arch/arm/mach-uniphier/pinctrl-glue.c
index b45f72f59a..2e07264695 100644
--- a/arch/arm/mach-uniphier/pinctrl-glue.c
+++ b/arch/arm/mach-uniphier/pinctrl-glue.c
@@ -4,7 +4,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <linux/errno.h>
 #include <dm.h>
 #include <dm/pinctrl.h>
diff --git a/arch/arm/mach-uniphier/reset.c b/arch/arm/mach-uniphier/reset.c
index 92a8b92547..5fffd23e9a 100644
--- a/arch/arm/mach-uniphier/reset.c
+++ b/arch/arm/mach-uniphier/reset.c
@@ -5,7 +5,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <cpu_func.h>
 #include <linux/io.h>
 #include <asm/secure.h>
diff --git a/arch/arm/mach-uniphier/sbc/sbc-ld11.c b/arch/arm/mach-uniphier/sbc/sbc-ld11.c
index 21972ac949..a0162e1cc8 100644
--- a/arch/arm/mach-uniphier/sbc/sbc-ld11.c
+++ b/arch/arm/mach-uniphier/sbc/sbc-ld11.c
@@ -3,7 +3,6 @@ 
  * Copyright (C) 2016-2017 Socionext Inc.
  */
 
-#include <common.h>
 #include <spl.h>
 #include <linux/io.h>
 
diff --git a/arch/arm/mach-uniphier/sbc/sbc.c b/arch/arm/mach-uniphier/sbc/sbc.c
index af8d6f4f9d..2100f49a08 100644
--- a/arch/arm/mach-uniphier/sbc/sbc.c
+++ b/arch/arm/mach-uniphier/sbc/sbc.c
@@ -5,7 +5,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <linux/io.h>
 #include <asm/global_data.h>
 
diff --git a/arch/arm/mach-uniphier/spl_board_init.c b/arch/arm/mach-uniphier/spl_board_init.c
index c7262d70a5..bd89f7217d 100644
--- a/arch/arm/mach-uniphier/spl_board_init.c
+++ b/arch/arm/mach-uniphier/spl_board_init.c
@@ -4,7 +4,6 @@ 
  *   Author: Masahiro Yamada <yamada.masahiro@socionext.com>
  */
 
-#include <common.h>
 #include <debug_uart.h>
 #include <hang.h>
 #include <spl.h>