[U-Boot] [PATCH 02/10] ARM: socfpga: arria10: add system manager defines

Marek Vasut marex at denx.de
Thu Nov 19 23:27:52 CET 2015


On Thursday, November 19, 2015 at 10:35:39 PM, dinguyen at opensource.altera.com 
wrote:

Hi!

[...]

> +/* Input buffer enable */
> +#define INPUT_BUF_DISABLE	(0)
> +#define INPUT_BUF_1P8V		(1)
> +#define INPUT_BUF_2P5V3V	(2)

You can drop those parenthesis around the number

> +/* Weak pull up enable */
> +#define WK_PU_DISABLE		(0)
> +#define WK_PU_ENABLE		(1)
> +
> +/* Pull up slew rate control */
> +#define PU_SLW_RT_SLOW		(0)
> +#define PU_SLW_RT_FAST		(1)
> +#define PU_SLW_RT_DEFAULT	PU_SLW_RT_SLOW
> +
> +/* Pull down slew rate control */
> +#define PD_SLW_RT_SLOW		(0)
> +#define PD_SLW_RT_FAST		(1)
> +#define PD_SLW_RT_DEFAULT	PD_SLW_RT_SLOW
> +
> +/* Drive strength control */
> +#define PU_DRV_STRG_DEFAULT	(0x10)
> +#define PD_DRV_STRG_DEFAULT	(0x10)
> +
> +/* bit position */
> +#define PD_DRV_STRG_LSB		(0)
> +#define PD_SLW_RT_LSB		(5)
> +#define PU_DRV_STRG_LSB		(8)
> +#define PU_SLW_RT_LSB		(13)
> +#define WK_PU_LSB		(16)
> +#define INPUT_BUF_LSB		(17)
> +#define BIAS_TRIM_LSB		(19)
> +#define VOLTAGE_SEL_LSB		(0)
> +
> +#define ALT_SYSMGR_NOC_H2F_SET_MSK	0x00000001
> +#define ALT_SYSMGR_NOC_LWH2F_SET_MSK	0x00000010
> +#define ALT_SYSMGR_NOC_F2H_SET_MSK	0x00000100
> +#define ALT_SYSMGR_NOC_F2SDR0_SET_MSK	0x00010000
> +#define ALT_SYSMGR_NOC_F2SDR1_SET_MSK	0x00100000
> +#define ALT_SYSMGR_NOC_F2SDR2_SET_MSK	0x01000000
> +#define ALT_SYSMGR_NOC_TMO_EN_SET_MSK	0x00000001
> +
> +#define ALT_SYSMGR_ECC_INTSTAT_SERR_OCRAM_SET_MSK    0x00000002
> +#define ALT_SYSMGR_ECC_INTSTAT_DERR_OCRAM_SET_MSK    0x00000002
> +
> +#define SYSMGR_A10_SDMMC_CTRL_SET(smplsel, drvsel)	\
> +	((drvsel << 0) & 0x7) | ((smplsel << 4) & 0x70)

You should use parenthesis around the variables in the macro.

> +#endif /* _SOCFPGA_SYSTEM_MANAGER_A10_H_ */


More information about the U-Boot mailing list