Fixes for smbus
This commit is contained in:
		
							
								
								
									
										8
									
								
								src/board/system76/galp3-c/include/board/smbus.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								src/board/system76/galp3-c/include/board/smbus.h
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,8 @@
 | 
			
		||||
#ifndef _BOARD_SMBUS_H
 | 
			
		||||
#define _BOARD_SMBUS_H
 | 
			
		||||
 | 
			
		||||
#include <ec/smbus.h>
 | 
			
		||||
 | 
			
		||||
void smbus_init(void);
 | 
			
		||||
 | 
			
		||||
#endif // _BOARD_SMBUS_H
 | 
			
		||||
@@ -10,6 +10,7 @@
 | 
			
		||||
#include <board/pmc.h>
 | 
			
		||||
#include <board/ps2.h>
 | 
			
		||||
#include <board/pwm.h>
 | 
			
		||||
#include <board/smbus.h>
 | 
			
		||||
#include <common/macro.h>
 | 
			
		||||
 | 
			
		||||
void external_0(void) __interrupt(0) {
 | 
			
		||||
@@ -43,8 +44,9 @@ void init(void) {
 | 
			
		||||
    pmc_init();
 | 
			
		||||
    kbscan_init();
 | 
			
		||||
    pwm_init();
 | 
			
		||||
    smbus_init();
 | 
			
		||||
 | 
			
		||||
    //TODO: INTC, PECI, SMBUS
 | 
			
		||||
    //TODO: INTC, PECI
 | 
			
		||||
 | 
			
		||||
    // PECI information can be found here: https://www.intel.com/content/dam/www/public/us/en/documents/design-guides/core-i7-lga-2011-guide.pdf
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										11
									
								
								src/board/system76/galp3-c/smbus.c
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										11
									
								
								src/board/system76/galp3-c/smbus.c
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,11 @@
 | 
			
		||||
#include <board/smbus.h>
 | 
			
		||||
 | 
			
		||||
void smbus_init(void) {
 | 
			
		||||
    SMB4P7USL = 0x2F;
 | 
			
		||||
    SMB4P0USL = 0x5A;
 | 
			
		||||
    SMB300NS = 0x03;
 | 
			
		||||
    SMB250NS = 0x30;
 | 
			
		||||
    SMB25MS = 0x19;
 | 
			
		||||
    SMB45P3USL = 0x5C;
 | 
			
		||||
    SMB45P3USH = 0x01;
 | 
			
		||||
}
 | 
			
		||||
@@ -42,5 +42,13 @@ volatile uint8_t __xdata __at(0x1C10) HOCTL2A;
 | 
			
		||||
// SMCLK timing setting for channel A
 | 
			
		||||
volatile uint8_t __xdata __at(0x1C10) SCLKTSA;
 | 
			
		||||
 | 
			
		||||
// Timing registers
 | 
			
		||||
volatile uint8_t __xdata __at(0x1C22) SMB4P7USL;
 | 
			
		||||
volatile uint8_t __xdata __at(0x1C23) SMB4P0USL;
 | 
			
		||||
volatile uint8_t __xdata __at(0x1C24) SMB300NS;
 | 
			
		||||
volatile uint8_t __xdata __at(0x1C25) SMB250NS;
 | 
			
		||||
volatile uint8_t __xdata __at(0x1C26) SMB25MS;
 | 
			
		||||
volatile uint8_t __xdata __at(0x1C27) SMB45P3USL;
 | 
			
		||||
volatile uint8_t __xdata __at(0x1C28) SMB45P3USH;
 | 
			
		||||
 | 
			
		||||
#endif // _EC_SMBUS_H
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user