Exemple #1
0
static int tiocx_reload(struct cx_dev *cx_dev)
{
	int part_num = CX_DEV_NONE;
	int mfg_num = CX_DEV_NONE;
	nasid_t nasid = cx_dev->cx_id.nasid;

	if (bitstream_loaded(nasid)) {
		uint64_t cx_id;

		cx_id =
		    *(volatile uint64_t *)(TIO_SWIN_BASE(nasid, TIOCX_CORELET) +
					  WIDGET_ID);
		part_num = XWIDGET_PART_NUM(cx_id);
		mfg_num = XWIDGET_MFG_NUM(cx_id);
		DBG("part= 0x%x, mfg= 0x%x\n", part_num, mfg_num);
		/* just ignore it if it's a CE */
		if (part_num == TIO_CE_ASIC_PARTNUM)
			return 0;
	}

	cx_dev->cx_id.part_num = part_num;
	cx_dev->cx_id.mfg_num = mfg_num;

	/*
	 * Delete old device and register the new one.  It's ok if
	 * part_num/mfg_num == CX_DEV_NONE.  We want to register
	 * devices in the table even if a bitstream isn't loaded.
	 * That allows use to see that a bitstream isn't loaded via
	 * TIOCX_IOCTL_DEV_LIST.
	 */
	return cx_device_reload(cx_dev);
}
static int tiocx_reload(struct cx_dev *cx_dev)
{
	int part_num = CX_DEV_NONE;
	int mfg_num = CX_DEV_NONE;
	nasid_t nasid = cx_dev->cx_id.nasid;

	if (bitstream_loaded(nasid)) {
		u64 cx_id;
		int rv;

		rv = ia64_sn_sysctl_tio_clock_reset(nasid);
		if (rv) {
			printk(KERN_ALERT "CX port JTAG reset failed.\n");
		} else {
			cx_id = *(volatile u64 *)
				(TIO_SWIN_BASE(nasid, TIOCX_CORELET) +
					  WIDGET_ID);
			part_num = XWIDGET_PART_NUM(cx_id);
			mfg_num = XWIDGET_MFG_NUM(cx_id);
			DBG("part= 0x%x, mfg= 0x%x\n", part_num, mfg_num);
			/*                             */
			if (part_num == TIO_CE_ASIC_PARTNUM)
				return 0;
		}
	}

	cx_dev->cx_id.part_num = part_num;
	cx_dev->cx_id.mfg_num = mfg_num;

	/*
                                                           
                                                         
                                                          
                                                            
                         
  */
	return cx_device_reload(cx_dev);
}