[U-Boot] [PATCH 1/3] omap: Add routine for setting fastboot variables

Lokesh Vutla lokeshvutla at ti.com
Fri May 19 02:03:12 UTC 2017



On Thursday 18 May 2017 06:31 PM, Sam Protsenko wrote:
> This patch reuses new option, which allows us to expose variables
> from environment to "fastboot getvar" command. Those variables must be
> of "fastboot.%s" format.
> 
> Signed-off-by: Sam Protsenko <semen.protsenko at linaro.org>
> ---
>  arch/arm/include/asm/omap_common.h |   2 +
>  arch/arm/mach-omap2/utils.c        | 134 +++++++++++++++++++++++++++++++++++++
>  2 files changed, 136 insertions(+)
> 
> diff --git a/arch/arm/include/asm/omap_common.h b/arch/arm/include/asm/omap_common.h
> index c1a70b15d0..cede2f7b28 100644
> --- a/arch/arm/include/asm/omap_common.h
> +++ b/arch/arm/include/asm/omap_common.h
> @@ -643,6 +643,8 @@ void omap_die_id_get_board_serial(struct tag_serialnr *serialnr);
>  void omap_die_id_usbethaddr(void);
>  void omap_die_id_display(void);
>  
> +void omap_set_fastboot_vars(void);
> +
>  void recalibrate_iodelay(void);
>  
>  void omap_smc1(u32 service, u32 val);
> diff --git a/arch/arm/mach-omap2/utils.c b/arch/arm/mach-omap2/utils.c
> index 2d03ebfbd3..0689c879b0 100644
> --- a/arch/arm/mach-omap2/utils.c
> +++ b/arch/arm/mach-omap2/utils.c
> @@ -6,6 +6,16 @@
>   */
>  #include <common.h>
>  #include <asm/arch/sys_proto.h>
> +
> +/* Device type bits in CONTROL_STATUS register */
> +#define DEVICETYPE_OFFSET	6
> +#define DEVICETYPE_MASK		(0x7 << DEVICETYPE_OFFSET)
> +#define OMAP_TYPE_TEST		0x0
> +#define OMAP_TYPE_EMU		0x1
> +#define OMAP_TYPE_SEC		0x2
> +#define OMAP_TYPE_GP		0x3
> +#define OMAP_TYPE_BAD		0x4
> +
>  static void do_cancel_out(u32 *num, u32 *den, u32 factor)
>  {
>  	while (1) {
> @@ -18,6 +28,122 @@ static void do_cancel_out(u32 *num, u32 *den, u32 factor)
>  	}
>  }
>  
> +static const char *omap_get_cpu_type(void)
> +{
> +	u32 type;
> +
> +	type = readl((*ctrl)->control_status);
> +	type &= DEVICETYPE_MASK;
> +	type >>= DEVICETYPE_OFFSET;
> +
> +	switch (type) {
> +	case OMAP_TYPE_EMU:
> +		return "EMU";
> +	case OMAP_TYPE_SEC:
> +		return "HS";
> +	case OMAP_TYPE_GP:
> +		return "GP";
> +	default:
> +		return NULL;
> +	}
> +}

use get_device_type() and drop this function.

Thanks and regards,
Lokesh



More information about the U-Boot mailing list