[U-Boot] [PATCH v2 2/9] arc: add cpu files

Wolfgang Denk wd at denx.de
Wed Jan 29 21:06:59 CET 2014


Dear Alexey Brodkin,

In message <1391011745-22239-3-git-send-email-abrodkin at synopsys.com> you wrote:
> Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
> 
> Cc: Mischa Jonker <mjonker at synopsys.com>
> Cc: Francois Bedard <fbedard at synopsys.com>
> 
> No changes for v2.

This belongs into the comment section (below the "---" line), not into
the commit message.

> ---
...
> +int icache_status(void)
> +{
> +	return (read_aux_reg(ARC_REG_IC_CTRL) & IC_CTRL_CACHE_DISABLE) !=
> +			IC_CTRL_CACHE_DISABLE;
> +}
> +
> +void icache_enable(void)
> +{
> +	write_aux_reg(ARC_REG_IC_CTRL, read_aux_reg(ARC_REG_IC_CTRL) &
> +		      ~IC_CTRL_CACHE_DISABLE);
> +}


I missed this in patch # 1 - why do you need these read_aux_reg() /
write_aux_reg() macros?  Why cannot you use standard I/O accessors
instead?


> +/* STATUS32 register bits related to Interrupt Handling */
> +#define STATUS_E1_BIT		1	/* Int 1 enable */
> +#define STATUS_E2_BIT		2	/* Int 2 enable */
> +#define STATUS_A1_BIT		3	/* Int 1 active */
> +#define STATUS_A2_BIT		4	/* Int 2 active */
> +
> +#define STATUS_E1_MASK		(1<<STATUS_E1_BIT)
> +#define STATUS_E2_MASK		(1<<STATUS_E2_BIT)
> +#define STATUS_A1_MASK		(1<<STATUS_A1_BIT)
> +#define STATUS_A2_MASK		(1<<STATUS_A2_BIT)

See before.

> +int disable_interrupts(void)
> +{
> +	int status = read_aux_reg(ARC_REG_STATUS32);
> +	int state = (status | STATUS_E1_MASK | STATUS_E2_MASK) ? 1 : 0;
> +	status &= ~(STATUS_E1_MASK | STATUS_E2_MASK);
> +	__asm__("flag %0" : : "r" (status));
> +	return state;
> +}

Please insert blankk line between declarations and code.  Please fix
globally.

> +void enable_interrupts(void)
> +{
> +	unsigned int status = read_aux_reg(ARC_REG_STATUS32);
> +	status |= STATUS_E1_MASK | STATUS_E2_MASK;
> +	__asm__("flag %0" : : "r" (status));
> +}
> +
> +/*
> + * Common routine to print scratch regs (r0-r12) or callee regs (r13-r25)
> + *   -Prints 3 regs per line and a CR.

Comment and code disagree: You print "\n", not "\r" !


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
GUIs  are  virtually  useless.  Learn  tools.  They're  configurable,
scriptable, automatable, cron-able, interoperable, etc. We don't need
no brain-dead winslurping monolithic claptrap.
                               -- Tom Christiansen in 371140df at csnews


More information about the U-Boot mailing list