[U-Boot] [PATCH 3/3] x86: coreboot: Wrap cros_ec initialization

Simon Glass sjg at chromium.org
Sun Jan 4 03:33:38 CET 2015


Hi Bin,

On 3 January 2015 at 07:40, Bin Meng <bmeng.cn at gmail.com> wrote:
> cros_ec_board_init() should be called only when CONFIG_CROS_EC is
> enabled. Also undef CONFIG_CROS_EC in the coreboot configuration.
>
> Signed-off-by: Bin Meng <bmeng.cn at gmail.com>
>
> ---
>
>  board/coreboot/coreboot/coreboot.c | 2 ++
>  include/configs/coreboot.h         | 4 +++-
>  2 files changed, 5 insertions(+), 1 deletion(-)

Can we just remove the node in the device tree? The current 'coreboot'
config is designed to run on link (Chromebook Pixel) so it does have
an EC. Maybe we should have a separate device tree file for the qemu
version?

>
> diff --git a/board/coreboot/coreboot/coreboot.c b/board/coreboot/coreboot/coreboot.c
> index 154faf6..e076ea6 100644
> --- a/board/coreboot/coreboot/coreboot.c
> +++ b/board/coreboot/coreboot/coreboot.c
> @@ -10,8 +10,10 @@
>
>  int arch_early_init_r(void)
>  {
> +#ifdef CONFIG_CROS_EC
>         if (cros_ec_board_init())
>                 return -1;
> +#endif
>
>         return 0;
>  }
> diff --git a/include/configs/coreboot.h b/include/configs/coreboot.h
> index 990a2d1..e5fe5e0 100644
> --- a/include/configs/coreboot.h
> +++ b/include/configs/coreboot.h
> @@ -67,9 +67,11 @@
>
>  #define CONFIG_BOOTDELAY       2
>
> -#define CONFIG_CROS_EC
> +#undef CONFIG_CROS_EC
> +#ifdef CONFIG_CROS_EC
>  #define CONFIG_CROS_EC_LPC
>  #define CONFIG_CMD_CROS_EC
> +#endif
>  #define CONFIG_ARCH_EARLY_INIT_R
>
>  #endif /* __CONFIG_H */
> --
> 1.8.2.1
>

Regards,
Simon


More information about the U-Boot mailing list