Exemple #1
0
int hmfsi_target_probe(struct target *cfam, struct target *targets, int max_target_count)
{
	struct target *target = targets;
	uint64_t value, chip_id;
	int target_count = 0, i;

	for (i = 0; i < 8 && i < max_target_count; i++) {
		mfsi_target_init(target, "MFSI Port", 0x80000 + i * HMFSI_STRIDE, cfam);
		if (read_target(target, 0xc09, &value)) {
			target_del(target);
			continue;
		}

		/* Ignore unknown chip ids */
		chip_id = GETFIELD(PPC_BITMASK32(12, 19), value);
		if (chip_id != 0xea && chip_id != 0xd3) {
			target_del(target);
			continue;
		}

		target++;
		target_count++;
	}

	return target_count;
}
Exemple #2
0
enum chip_type get_chip_type(uint64_t chip_id)
{
	switch(GETFIELD(PPC_BITMASK32(12, 19), chip_id)) {
	case 0xea:
		return CHIP_P8;
	case 0xd3:
		return CHIP_P8NV;
	case 0xd1:
		return CHIP_P9;
	default:
		return CHIP_UNKNOWN;
	}
}