[U-Boot] [PATCH 3/5] zynq: Support CPU info display

Michal Simek michal.simek at xilinx.com
Fri Jan 26 12:33:41 UTC 2018


Hi,


On 17.1.2018 14:56, Ezequiel Garcia wrote:
> This commit adds CPU and silicon version information
> consuming the SLCR IDCODE and DEVCFG MCTRL registers,
> respectively.
> 
> Signed-off-by: Ariel D'Alessandro <ariel at vanguardiasur.com.ar>
> Signed-off-by: Ezequiel Garcia <ezequiel at vanguardiasur.com.ar>
> ---
>  arch/arm/mach-zynq/cpu.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 46 insertions(+)
> 
> diff --git a/arch/arm/mach-zynq/cpu.c b/arch/arm/mach-zynq/cpu.c
> index 53a07b0059c2..602f483c162b 100644
> --- a/arch/arm/mach-zynq/cpu.c
> +++ b/arch/arm/mach-zynq/cpu.c
> @@ -35,6 +35,25 @@ static const struct {
>  };
>  #endif
>  
> +#ifdef CONFIG_DISPLAY_CPUINFO
> +static const struct {
> +	u8 idcode;
> +	const char *cpuinfo;
> +} zynq_cpu_info[] = {
> +	{ .idcode = XILINX_ZYNQ_7007S,	.cpuinfo = XILINX_XC7Z007S_NAME },
> +	{ .idcode = XILINX_ZYNQ_7010,	.cpuinfo = XILINX_XC7Z010_NAME },
> +	{ .idcode = XILINX_ZYNQ_7012S,	.cpuinfo = XILINX_XC7Z012S_NAME },
> +	{ .idcode = XILINX_ZYNQ_7014S,	.cpuinfo = XILINX_XC7Z014S_NAME },
> +	{ .idcode = XILINX_ZYNQ_7015,	.cpuinfo = XILINX_XC7Z015_NAME },
> +	{ .idcode = XILINX_ZYNQ_7020,	.cpuinfo = XILINX_XC7Z020_NAME },
> +	{ .idcode = XILINX_ZYNQ_7030,	.cpuinfo = XILINX_XC7Z030_NAME },
> +	{ .idcode = XILINX_ZYNQ_7035,	.cpuinfo = XILINX_XC7Z035_NAME },
> +	{ .idcode = XILINX_ZYNQ_7045,	.cpuinfo = XILINX_XC7Z045_NAME },
> +	{ .idcode = XILINX_ZYNQ_7100,	.cpuinfo = XILINX_XC7Z100_NAME },
> +	{ /* Sentinel */ },

This table pretty much reflect what it is in 2/5.

static const struct {
	u8 idcode;
	const char *cpuinfo; /* or better name devicename */
	u32 fpga_size;
} zynq_cpu_info[] = {

>From xilinx_desc I think size is unused but we can keep in filled and
cookie is also not used and can be 0. The rest of data for xilinx_desc
is static anyway.

It means doing this properly will be the best to fill that xilinx_desc
and also it doesn't make sense to call zynq_slcr_get_idcode() twice.
It should be enough to detect chip once and fill pointer to actual
configuration. And then when fpga should be add then use them. The same
for cpuinfo. Link is already setup and you can just use it.

Thanks,
Michal


More information about the U-Boot mailing list