siemens/nc_fpga: Expand FPGA functionality

The siemens/mc_apl1 mainboard needs more functionality provided by
Siemens NC FPGA. The additional functionality contains backlight
brightness/PWM control and Dsave time for board reset.

Change-Id: I6b65b01f0d67afe598b7c005868f71b00dec56fd
Signed-off-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-on: https://review.coreboot.org/20160
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Mario Scheithauer 2017-06-12 10:02:10 +02:00 committed by Werner Zeh
parent 59dd466414
commit c4ff1de8bf
2 changed files with 24 additions and 8 deletions

View File

@ -119,6 +119,17 @@ static void nc_fpga_init(struct device *dev)
init_temp_mon(bar0_ptr + NC_FANMON_CTRL_OFFSET);
if (cap & NC_CAP1_FAN_CTRL)
init_fan_ctrl(bar0_ptr + NC_FANMON_CTRL_OFFSET);
if (cap & NC_CAP1_DSAVE_NMI_DELAY) {
uint16_t *dsave_ptr = (uint16_t *)(bar0_ptr + NC_DSAVE_OFFSET);
FPGA_SET_PARAM(NvramVirtTimeDsaveReset, *dsave_ptr);
}
if (cap & NC_CAP1_BL_BRIGHTNESS_CTRL) {
uint8_t *bl_bn_ptr =
(uint8_t *)(bar0_ptr + NC_BL_BRIGHTNESS_OFFSET);
uint8_t *bl_pwm_ptr = (uint8_t *)(bar0_ptr + NC_BL_PWM_OFFSET);
FPGA_SET_PARAM(BL_Brightness, *bl_bn_ptr);
FPGA_SET_PARAM(PF_PwmFreq, *bl_pwm_ptr);
}
}
static struct device_operations nc_fpga_ops = {
@ -130,10 +141,10 @@ static struct device_operations nc_fpga_ops = {
.ops_pci = 0,
};
static const unsigned short nc_fpga_device_ids[] = { 0x4091, 0 };
static const unsigned short nc_fpga_device_ids[] = { 0x4080, 0x4091, 0 };
static const struct pci_driver nc_fpga_driver __pci_driver = {
.ops = &nc_fpga_ops,
.vendor = 0x110A,
.vendor = PCI_VENDOR_ID_SIEMENS,
.devices = nc_fpga_device_ids,
};

View File

@ -19,8 +19,13 @@
#define NC_MAGIC_OFFSET 0x020
#define NC_FPGA_MAGIC 0x4E433746
#define NC_CAP1_OFFSET 0x080
#define NC_CAP1_DSAVE_NMI_DELAY 0x008
#define NC_CAP1_BL_BRIGHTNESS_CTRL 0x010
#define NC_CAP1_FAN_CTRL 0x080
#define NC_CAP1_TEMP_MON 0x100
#define NC_DSAVE_OFFSET 0x58
#define NC_BL_BRIGHTNESS_OFFSET 0x88
#define NC_BL_PWM_OFFSET 0x8C
#define NC_FANMON_CTRL_OFFSET 0x400
#define MAX_NUM_SENSORS 4