diff options
author | Mario Scheithauer <mario.scheithauer@siemens.com> | 2017-06-12 10:02:10 +0200 |
---|---|---|
committer | Werner Zeh <werner.zeh@siemens.com> | 2017-06-13 10:27:19 +0200 |
commit | c4ff1de8bf65718a7fcb1aa3a77f7024140fecef (patch) | |
tree | 3b7ca4ba72860b01a3f3a908abeb86209a1d68a8 /src/drivers | |
parent | 59dd4664148ffcff5af4b23b320bf9bb99c28a63 (diff) | |
download | coreboot-c4ff1de8bf65718a7fcb1aa3a77f7024140fecef.tar.xz |
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>
Diffstat (limited to 'src/drivers')
-rw-r--r-- | src/drivers/siemens/nc_fpga/nc_fpga.c | 15 | ||||
-rw-r--r-- | src/drivers/siemens/nc_fpga/nc_fpga.h | 17 |
2 files changed, 24 insertions, 8 deletions
diff --git a/src/drivers/siemens/nc_fpga/nc_fpga.c b/src/drivers/siemens/nc_fpga/nc_fpga.c index def456bbb6..59e7d4bd2f 100644 --- a/src/drivers/siemens/nc_fpga/nc_fpga.c +++ b/src/drivers/siemens/nc_fpga/nc_fpga.c @@ -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, }; diff --git a/src/drivers/siemens/nc_fpga/nc_fpga.h b/src/drivers/siemens/nc_fpga/nc_fpga.h index 886f3dda05..a5a7ab8faf 100644 --- a/src/drivers/siemens/nc_fpga/nc_fpga.h +++ b/src/drivers/siemens/nc_fpga/nc_fpga.h @@ -16,12 +16,17 @@ #ifndef _SIEMENS_NC_FPGA_H_ #define _SIEMENS_NC_FPGA_H_ -#define NC_MAGIC_OFFSET 0x020 -#define NC_FPGA_MAGIC 0x4E433746 -#define NC_CAP1_OFFSET 0x080 -#define NC_CAP1_FAN_CTRL 0x080 -#define NC_CAP1_TEMP_MON 0x100 -#define NC_FANMON_CTRL_OFFSET 0x400 +#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 |