diff --git a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/cplds.h b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/cplds.h deleted file mode 100644 index e0f7db06..00000000 --- a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/cplds.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef __CPLDS_H__ -#define __CPLDS_H__ - -int cpld_io_init(void); -int cpld_read(int addr); -void cpld_write(int addr, uint8_t value); -void cpld_modify(int addr, uint8_t andmask, uint8_t ormask); -int cpld_dump(aim_pvs_t* pvs, int cpldid); - -#endif /* __CPLDS_H__ */ - - diff --git a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/i2c_chips.c b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/i2c_chips.c index f2928b46..84b1cfc6 100644 --- a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/i2c_chips.c +++ b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/i2c_chips.c @@ -10,11 +10,10 @@ #include -#include "cpld.h" #include "i2c_dev.h" #include "i2c_chips.h" +#include "redstone_cpld.h" -//#define PSOC_TAKE_I2C #define PSOC_CTRL_SMBUS 0x01 static struct ts_info ts[] = { @@ -36,36 +35,33 @@ static const struct dev_info i2c_dev[NUM_CHIPS] = { #define FANGROUP_NUM 4 static const struct fan_config fan[FAN_NUM] = { - {0x4D, 0x4E, 0x40},//Fan 1 Front - {0x2E, 0x4E, 0x40},//Fan 1 Rear - {0x4D, 0x6E, 0x60},//Fan 2 F - {0x2e, 0x3E, 0x30},//Fan 2 R - {0x4D, 0x5E, 0x50},//Fan 3 F - {0x2E, 0x7E, 0x70},//Fan 3 R - {0x4D, 0x3E, 0x30},//Fan 4 F - {0x2E, 0x5E, 0x50},//Fan 4 R + {0x4D, 0x4E, 0x40}, //Fan 1 Front + {0x2E, 0x4E, 0x40}, //Fan 1 Rear + {0x4D, 0x6E, 0x60}, //Fan 2 F + {0x2e, 0x3E, 0x30}, //Fan 2 R + {0x4D, 0x5E, 0x50}, //Fan 3 F + {0x2E, 0x7E, 0x70}, //Fan 3 R + {0x4D, 0x3E, 0x30}, //Fan 4 F + {0x2E, 0x5E, 0x50}, //Fan 4 R }; static struct led_gpio ledGpio[] = { - {32, 31},//4_0,3_7, gpio(x_y) = x*8+y - {30, 29},//3_6,3_5 - /*{36, 35},//4_4,4_3 For smallstone*/ - {38, 37},//4_6,4_5 - {34, 33},//4_2,4_1 + {32, 31}, //4_0,3_7, gpio(x_y) = x*8+y + {30, 29}, //3_6,3_5 + {38, 37}, //4_6,4_5 + {34, 33}, //4_2,4_1 }; static unsigned char airFlowGpio[] = { - 16,//IO2_0 gpio = 2*8+0, gpio(x_y) = x*8+y - 15,//IO1_7 - /*18,//IO2_2 //For smallstone */ - 19,//IO2_3 - 17,//IO2_1 + 16, //IO2_0 gpio = 2*8+0, gpio(x_y) = x*8+y + 15, //IO1_7 + 19, //IO2_3 + 17, //IO2_1 }; static unsigned char presentGpio[] = { - 11,//IO1_3 gpio = 2*8+0, gpio(x_y) = x*8+y - 10,//IO1_2 - /* 13,//IO1_5 //For smallstone */ - 14,//IO1_6 - 12,//IO1_4 + 11, //IO1_3 gpio = 2*8+0, gpio(x_y) = x*8+y + 10, //IO1_2 + 14, //IO1_6 + 12, //IO1_4 }; static int has_been_read = 0; diff --git a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/platform.h b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/platform.h index d215ff20..8753f424 100644 --- a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/platform.h +++ b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/platform.h @@ -1,5 +1,5 @@ -#ifndef CPLD_H -#define CPLD_H +#ifndef _PLATFORM_REDSTONE_H_ +#define _PLATFORM_REDSTONE_H_ #define FAN_COUNT 10 #define PSU_FAN 8 @@ -25,4 +25,4 @@ #define LED_PSU_1 9 #define LED_PSU_2 10 -#endif +#endif /* _PLATFORM_REDSTONE_H_ */ diff --git a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/cplds.c b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/redstone_cpld.c similarity index 98% rename from packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/cplds.c rename to packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/redstone_cpld.c index d9c6e1ae..f70b3178 100644 --- a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/cplds.c +++ b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/redstone_cpld.c @@ -5,7 +5,7 @@ #include #include "x86_64_cel_redstone_xp_log.h" #include "x86_64_cel_redstone_xp_int.h" -#include "cplds.h" +#include "redstone_cpld.h" int cpld_io_init(void) @@ -78,7 +78,6 @@ cpld_dump(aim_pvs_t* pvs, int cpldid) } -// EXPERIMENT #define PORT_BANK1_START 1 #define PORT_BANK1_END 18 #define PORT_BANK2_START 19 @@ -209,9 +208,7 @@ read_sfp(int portID, char devAddr, char reg, char *data, int len) outb(reg, ioBase + cmdbyte0); } } -// FIXME return writedata * 0; -// return 0; } int @@ -320,8 +317,6 @@ write_sfp(int portID, char devAddr, char reg, char *data, int len) outb(ioBase + cmdbyte0, reg); } } -// FIXME return writedata * readdata * 0; -// return 0; } diff --git a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/cpld.h b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/redstone_cpld.h similarity index 81% rename from packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/cpld.h rename to packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/redstone_cpld.h index 3b73e3cd..2dffc7b2 100644 --- a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/cpld.h +++ b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/redstone_cpld.h @@ -1,6 +1,8 @@ -#ifndef CPLD_H -#define CPLD_H +#ifndef _REDSTONE_CPLD_H_ +#define _REDSTONE_CPLD_H_ +#include +#include #include #define BIT0 0x1 @@ -58,4 +60,10 @@ int write_cpld(int reg, unsigned char value); int read_sfp(int portID, char devAddr, char reg, char *data, int len); int write_sfp(int portID, char devAddr, char reg, char *data, int len); -#endif +int cpld_io_init(void); +int cpld_read(int addr); +void cpld_write(int addr, uint8_t value); +void cpld_modify(int addr, uint8_t andmask, uint8_t ormask); +int cpld_dump(aim_pvs_t* pvs, int cpldid); + +#endif /* _REDSTONE_CPLD_H_ */ diff --git a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sfpi.c b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sfpi.c index 5f0ed0d8..f4764ed5 100644 --- a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sfpi.c +++ b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sfpi.c @@ -6,7 +6,7 @@ #include #include -#include "cpld.h" +#include "redstone_cpld.h" #include "x86_64_cel_redstone_xp_int.h" #include "sfp_xfp.h" diff --git a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sys_eeprom.c b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sys_eeprom.c index bd07caa9..488937cd 100644 --- a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sys_eeprom.c +++ b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sys_eeprom.c @@ -6,9 +6,9 @@ #include #include "sys_eeprom.h" -#include "cpld.h" #include "i2c_chips.h" #include "i2c_dev.h" +#include "redstone_cpld.h" static inline u_int8_t is_valid_tlvinfo_header(tlvinfo_header_t *hdr) { diff --git a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sysi.c b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sysi.c index 98fe0b73..c3bf8bc1 100644 --- a/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sysi.c +++ b/packages/platforms/celestica/x86-64/x86-64-cel-redstone-xp/onlp/builds/src/module/src/sysi.c @@ -8,8 +8,8 @@ #include "x86_64_cel_redstone_xp_log.h" #include "platform.h" -#include "cplds.h" #include "sys_eeprom.h" +#include "redstone_cpld.h" const char* onlp_sysi_platform_get(void)