public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] Tegra-specific header file location
@ 2016-03-30 22:48 Stephen Warren
  2016-03-31  8:00 ` Masahiro Yamada
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Warren @ 2016-03-30 22:48 UTC (permalink / raw)
  To: u-boot

Masahiro,

I'm about to work on some refactoring of the Tegra-specific header files 
in U-Boot to enable support for another Tegra variant. I'd like to 
confirm where you think header files should be located before doing that.

I believe you want Tegra-specific headers moved into 
arch/arm/mach-tegra/include. That would probably be a good location for 
headers currently in arch/arm/include/asm/arch-tegra/. Does that sound 
correct to you?

What about SoC-specific headers currently in 
arch/arm/include/asm/arch-tegraNNN/; should they move to 
arch/arm/mach-tegra/tegraNNN/include?

A number of those header files primarily contain driver-internal 
definitions such as HW register layouts. I'd like to propose moving this 
private information into the relevant drivers/ directories where the 
driver implementation already is. There is no need to place it in an 
include directory where any C file could include it. For example, 99% of 
arch/arm/include/asm/arch-tegra/tegra_mmc.h might move to 
drivers/mmc/tegra_mmc_{priv,internal}.h or even into 
drivers/mmc/tegra_mmc.c itself. The only thing that wouldn't move is the 
public prototype for pad_init_mmc(); a function the MMC driver calls and 
board code is expected to implement. I am considering making a single 
header that defines all those Tegra-specific function prototypes so we 
can reduce the number of header files too. What do you think about this.

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

* [U-Boot] Tegra-specific header file location
  2016-03-30 22:48 [U-Boot] Tegra-specific header file location Stephen Warren
@ 2016-03-31  8:00 ` Masahiro Yamada
  0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2016-03-31  8:00 UTC (permalink / raw)
  To: u-boot

Hi Stephen,


2016-03-31 7:48 GMT+09:00 Stephen Warren <swarren@wwwdotorg.org>:
> Masahiro,
>
> I'm about to work on some refactoring of the Tegra-specific header files in
> U-Boot to enable support for another Tegra variant. I'd like to confirm
> where you think header files should be located before doing that.
>
> I believe you want Tegra-specific headers moved into
> arch/arm/mach-tegra/include.

Yes. I think it is better to collect SoC code into a single directory.


> That would probably be a good location for
> headers currently in arch/arm/include/asm/arch-tegra/. Does that sound
> correct to you?
>
> What about SoC-specific headers currently in
> arch/arm/include/asm/arch-tegraNNN/; should they move to
> arch/arm/mach-tegra/tegraNNN/include?

This is up to you.
arch/arm/mach-tegra/tegraNNN/include looks good to me, though.


> A number of those header files primarily contain driver-internal definitions
> such as HW register layouts. I'd like to propose moving this private
> information into the relevant drivers/ directories where the driver
> implementation already is. There is no need to place it in an include
> directory where any C file could include it. For example, 99% of
> arch/arm/include/asm/arch-tegra/tegra_mmc.h might move to
> drivers/mmc/tegra_mmc_{priv,internal}.h or even into drivers/mmc/tegra_mmc.c
> itself. The only thing that wouldn't move is the public prototype for
> pad_init_mmc(); a function the MMC driver calls and board code is expected
> to implement. I am considering making a single header that defines all those
> Tegra-specific function prototypes so we can reduce the number of header
> files too. What do you think about this.

Great idea!

Ultimately, arch/arm/mach-<soc>/include/ may go away (like Linux)
if we convert all the drivers to driver model.

Please note there is neither arch/arm/mach-uniphier/include/mach/
nor arch/arm/include/asm/arch-uniphier/.


-- 
Best Regards
Masahiro Yamada

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

end of thread, other threads:[~2016-03-31  8:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-30 22:48 [U-Boot] Tegra-specific header file location Stephen Warren
2016-03-31  8:00 ` Masahiro Yamada

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