/* Return: number of memory channels in operation Pass back: contents of the DCL0_LOW register  */
static int k8_early_channel_count(struct amd64_pvt *pvt)
/* Return: number of memory channels in operation Pass back: contents of the DCL0_LOW register  */
static int k8_early_channel_count(struct amd64_pvt *pvt)
{
	int flag, err = 0;
	err = amd64_read_pci_cfg(pvt->dram_f2_ctl, F10_DCLR_0, &pvt->dclr0);
	if (err)
		return err;
	if ((boot_cpu_data.x86_model >> 4) >= K8_REV_F) {
		flag = pvt->dclr0 & F10_WIDTH_128;
	} else {
		flag = pvt->dclr0 & REVE_WIDTH_128;
	}
	pvt->dclr1 = 0;
	return (flag) ? 2 : 1;
}