Lines Matching refs:intel_rng_hw
231 struct intel_rng_hw { struct
242 struct intel_rng_hw *intel_rng_hw = _intel_rng_hw; in intel_rng_hw_init() argument
247 if (!(intel_rng_hw->fwh_dec_en1_val & FWH_F8_EN_MASK)) in intel_rng_hw_init()
248 pci_write_config_byte(intel_rng_hw->dev, in intel_rng_hw_init()
249 intel_rng_hw->fwh_dec_en1_off, in intel_rng_hw_init()
250 intel_rng_hw->fwh_dec_en1_val | in intel_rng_hw_init()
252 if (!(intel_rng_hw->bios_cntl_val & BIOS_CNTL_WRITE_ENABLE_MASK)) in intel_rng_hw_init()
253 pci_write_config_byte(intel_rng_hw->dev, in intel_rng_hw_init()
254 intel_rng_hw->bios_cntl_off, in intel_rng_hw_init()
255 intel_rng_hw->bios_cntl_val | in intel_rng_hw_init()
258 writeb(INTEL_FWH_RESET_CMD, intel_rng_hw->mem); in intel_rng_hw_init()
259 writeb(INTEL_FWH_READ_ID_CMD, intel_rng_hw->mem); in intel_rng_hw_init()
260 mfc = readb(intel_rng_hw->mem + INTEL_FWH_MANUFACTURER_CODE_ADDRESS); in intel_rng_hw_init()
261 dvc = readb(intel_rng_hw->mem + INTEL_FWH_DEVICE_CODE_ADDRESS); in intel_rng_hw_init()
262 writeb(INTEL_FWH_RESET_CMD, intel_rng_hw->mem); in intel_rng_hw_init()
264 if (!(intel_rng_hw->bios_cntl_val & in intel_rng_hw_init()
266 pci_write_config_byte(intel_rng_hw->dev, in intel_rng_hw_init()
267 intel_rng_hw->bios_cntl_off, in intel_rng_hw_init()
268 intel_rng_hw->bios_cntl_val); in intel_rng_hw_init()
269 if (!(intel_rng_hw->fwh_dec_en1_val & FWH_F8_EN_MASK)) in intel_rng_hw_init()
270 pci_write_config_byte(intel_rng_hw->dev, in intel_rng_hw_init()
271 intel_rng_hw->fwh_dec_en1_off, in intel_rng_hw_init()
272 intel_rng_hw->fwh_dec_en1_val); in intel_rng_hw_init()
284 static int __init intel_init_hw_struct(struct intel_rng_hw *intel_rng_hw, in intel_init_hw_struct() argument
287 intel_rng_hw->bios_cntl_val = 0xff; in intel_init_hw_struct()
288 intel_rng_hw->fwh_dec_en1_val = 0xff; in intel_init_hw_struct()
289 intel_rng_hw->dev = dev; in intel_init_hw_struct()
293 intel_rng_hw->fwh_dec_en1_off = FWH_DEC_EN1_REG_OLD; in intel_init_hw_struct()
294 intel_rng_hw->bios_cntl_off = BIOS_CNTL_REG_OLD; in intel_init_hw_struct()
296 intel_rng_hw->fwh_dec_en1_off = FWH_DEC_EN1_REG_NEW; in intel_init_hw_struct()
297 intel_rng_hw->bios_cntl_off = BIOS_CNTL_REG_NEW; in intel_init_hw_struct()
300 pci_read_config_byte(dev, intel_rng_hw->fwh_dec_en1_off, in intel_init_hw_struct()
301 &intel_rng_hw->fwh_dec_en1_val); in intel_init_hw_struct()
302 pci_read_config_byte(dev, intel_rng_hw->bios_cntl_off, in intel_init_hw_struct()
303 &intel_rng_hw->bios_cntl_val); in intel_init_hw_struct()
305 if ((intel_rng_hw->bios_cntl_val & in intel_init_hw_struct()
320 intel_rng_hw->mem = ioremap_nocache(INTEL_FWH_ADDR, INTEL_FWH_ADDR_LEN); in intel_init_hw_struct()
321 if (intel_rng_hw->mem == NULL) in intel_init_hw_struct()
335 struct intel_rng_hw *intel_rng_hw; in mod_init() local
349 intel_rng_hw = kmalloc(sizeof(*intel_rng_hw), GFP_KERNEL); in mod_init()
350 if (!intel_rng_hw) { in mod_init()
355 err = intel_init_hw_struct(intel_rng_hw, dev); in mod_init()
358 kfree(intel_rng_hw); in mod_init()
372 err = stop_machine(intel_rng_hw_init, intel_rng_hw, NULL); in mod_init()
374 iounmap(intel_rng_hw->mem); in mod_init()
375 kfree(intel_rng_hw); in mod_init()