soc/intel/common/block/gpio: Add support to program VCCIO selection
Some of the Intel SoCs with more than 2 PAD configuration registers support programming VCCIO selection. Add a pad configuration macro to program VCCIO selection when the GPIO is an output pin. BUG=b:194120188 TEST=Build and boot to OS in Gallop. Ensure that the VCCIO selection is configured as expected and probing the GPIO reads the configured voltage. Change-Id: Icda33b3cc84f42ab87ca174b1fe12a5fa2184061 Signed-off-by: Karthikeyan Ramasubramanian <kramasub@google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/56507 Reviewed-by: Furquan Shaikh <furquan@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
		
				
					committed by
					
						
						Werner Zeh
					
				
			
			
				
	
			
			
			
						parent
						
							9b6a3a0370
						
					
				
				
					commit
					4c569b52f6
				
			@@ -36,4 +36,9 @@ config SOC_INTEL_COMMON_BLOCK_GPIO_DUAL_ROUTE_SUPPORT
 | 
			
		||||
	bool
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
# Used to program VCCIO Selection as 1.8V or 3.3V
 | 
			
		||||
config SOC_INTEL_COMMON_BLOCK_GPIO_PADCFG_VCCIOSEL
 | 
			
		||||
	bool
 | 
			
		||||
	default n
 | 
			
		||||
 | 
			
		||||
endif
 | 
			
		||||
 
 | 
			
		||||
@@ -39,7 +39,11 @@
 | 
			
		||||
			PAD_CFG1_IOSSTATE_MASK)
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if CONFIG(SOC_INTEL_COMMON_BLOCK_GPIO_PADCFG_VCCIOSEL)
 | 
			
		||||
#define PAD_DW2_MASK	(PAD_CFG2_VCCIOSEL_MASK | PAD_CFG2_DEBOUNCE_MASK)
 | 
			
		||||
#else
 | 
			
		||||
#define PAD_DW2_MASK	(PAD_CFG2_DEBOUNCE_MASK)
 | 
			
		||||
#endif /* SOC_INTEL_COMMON_BLOCK_GPIO_PADCFG_VCCIOSEL */
 | 
			
		||||
#define PAD_DW3_MASK	(0)
 | 
			
		||||
 | 
			
		||||
#define MISCCFG_GPE0_DW0_SHIFT 8
 | 
			
		||||
 
 | 
			
		||||
@@ -123,6 +123,14 @@
 | 
			
		||||
#define  PAD_CFG1_TOL_1V8		(0x1 << 25)
 | 
			
		||||
#endif /* CONFIG_SOC_INTEL_COMMON_BLOCK_GPIO_PADCFG_PADTOL */
 | 
			
		||||
 | 
			
		||||
/* On SoCs with more than 2 PAD_CFG registers, some of them support programmable VCCIO.
 | 
			
		||||
   0(default)=3.3V, 1=1.8V */
 | 
			
		||||
#if CONFIG(SOC_INTEL_COMMON_BLOCK_GPIO_PADCFG_VCCIOSEL)
 | 
			
		||||
#define PAD_CFG2_VCCIOSEL_MASK		(0x1 << 8)
 | 
			
		||||
#define PAD_CFG2_VCCIOSEL_3V3		(0x0 << 8)
 | 
			
		||||
#define PAD_CFG2_VCCIOSEL_1V8		(0x1 << 8)
 | 
			
		||||
#endif /* CONFIG_SOC_INTEL_COMMON_BLOCK_GPIO_PADCFG_VCCIOSEL */
 | 
			
		||||
 | 
			
		||||
#define PAD_FUNC(value)		PAD_CFG0_MODE_##value
 | 
			
		||||
#define PAD_RESET(value)	PAD_CFG0_LOGICAL_RESET_##value
 | 
			
		||||
#define PAD_RX_POL(value)	PAD_CFG0_RX_POL_##value
 | 
			
		||||
@@ -252,6 +260,14 @@
 | 
			
		||||
		PAD_TRIG(OFF) | PAD_BUF(RX_DISABLE) | !!val,			\
 | 
			
		||||
		PAD_PULL(pull) | PAD_IOSSTATE(iosstate) | PAD_IOSTERM(ioterm))
 | 
			
		||||
 | 
			
		||||
/* General purpose output with VCCIO Select. */
 | 
			
		||||
#define PAD_CFG_GPO_VCCIOSEL(pad, val, rst, vcciosel)		\
 | 
			
		||||
	_PAD_CFG_STRUCT_3(pad,					\
 | 
			
		||||
		PAD_FUNC(GPIO) | PAD_RESET(rst) |		\
 | 
			
		||||
		PAD_TRIG(OFF) | PAD_BUF(RX_DISABLE) | !!val,	\
 | 
			
		||||
		PAD_PULL(NONE) | PAD_IOSSTATE(TxLASTRxE),	\
 | 
			
		||||
		PAD_CFG2_VCCIOSEL_##vcciosel)
 | 
			
		||||
 | 
			
		||||
/* General purpose input */
 | 
			
		||||
#define PAD_CFG_GPI(pad, pull, rst)					\
 | 
			
		||||
	_PAD_CFG_STRUCT(pad,						\
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user