"Mark A. Greer" <[email protected]> writes:

> From: Mark A. Greer <[email protected]>
>
> Create a structure to encapsulate SoC-specific information.
> This will assist in generalizing code so it can be used by
> different SoCs that have similar hardware but with minor
> differences such as having a different base address.
>
> The idea is that the code for each SoC fills out a structure
> with the correct information.  The board-specific code can
> then modify anything in that structure before calling a
> common init routine that makes a copy of the structure,
> maps in I/O regions, etc.  Code can get a pointer to the
> structure by calling davinci_get_soc_info().  Eventually,
> the common init routine will make a copy of all of the data
> pointed to by the structure so the original data can be made
> __init_data.  That way the data for SoC's that aren't being
> used won't occupy space for the entire life of the kernel.
>
> The structure will be extended in subsequent patches but
> initially, it holds the map_desc structure for any I/O
> regions the SoC/board wants statically mapped.
>
> Signed-off-by: Mark A. Greer <[email protected]>

[...]

>  
>  #define DAVINCI_ASYNC_EMIF_CONTROL_BASE              0x01e10000
>  #define DAVINCI_ASYNC_EMIF_DATA_CE0_BASE     0x02000000
> @@ -189,8 +190,13 @@ static struct davinci_uart_config uart_config __initdata 
> = {
>  
>  static void __init dm355_evm_map_io(void)
>  {
> -     davinci_map_common_io();
> -     dm355_init();
> +     int ret;
> +
> +     ret = davinci_common_init(&davinci_soc_info_dm355);
> +     if (ret)
> +             pr_err("SoC Initialization failed\n");
> +     else
> +             dm355_init();

Hmm... you reworked this due to my suggestion, but I still don't quite
like this.

Seems like you've had to make davinci_soc_info_<soc> global only so
that it can be passed into common_init() from the board files.  Instead,
how about just keep the call to dm355_init(), and then, in dm355.c, call
common_init() with the soc_info struct statically defined there.

This keeps the SoC info struct local to the SoC specific file, and all
the board file has to know at this early init phase is which SoC it's
using.

Kevin


_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to