Issue with Linux installation on fit-PC2i

Post Reply
chutz
Posts: 5
Joined: Wed Feb 10, 2010 4:26 am

Issue with Linux installation on fit-PC2i

Post by chutz »

Hi, I just got my fit-pc2i and I am trying to install gentoo on it, but I can't seem to get any livecd to recognize the hard drive, both the gentoo minimal CD and the Ubuntu 9.10 livecd's only see the internal flash, but not the HDD. The copy of Ubuntu that came on the hard drive seems to work alright with the internal hard drive.

Loading pata-sch only makes the flash drive available, not the HDD.

Denis
Posts: 301
Joined: Sun Apr 26, 2009 3:24 pm

Re: fit-pc2i HDD on Linux

Post by Denis »

Hi,
fit-PC2i rev 1.1 requires patch for slave HDD detection

Code: Select all

--- a/drivers/ata/pata_sch.c	2009-09-10 01:13:59.000000000 +0300
+++ b/drivers/ata/pata_sch.c	2010-02-10 14:05:21.000000000 +0200
@@ -75,11 +75,53 @@
 	ATA_BMDMA_SHT(DRV_NAME),
 };
 
+/**
+ *	sch_tf_read - input device's ATA taskfile shadow registers
+ *	@ap: Port from which input is read
+ *	@tf: ATA taskfile register set for storing input
+ *
+ *	Note: Original code is ata_sff_tf_read().
+ */
+
+static void sch_tf_read (struct ata_port *ap, struct ata_taskfile *tf)
+{
+	struct ata_ioports *ioaddr = &ap->ioaddr;
+	int i;
+
+	tf->command = ata_sff_check_status(ap);
+	tf->feature = ioread8(ioaddr->error_addr);
+
+	/* FIX */
+	if (tf->feature == 0x81)
+		tf->feature = 0x1;
+
+	tf->nsect = ioread8(ioaddr->nsect_addr);
+	tf->lbal = ioread8(ioaddr->lbal_addr);
+	tf->lbam = ioread8(ioaddr->lbam_addr);
+	tf->lbah = ioread8(ioaddr->lbah_addr);
+	tf->device = ioread8(ioaddr->device_addr);
+	if (tf->flags & ATA_TFLAG_LBA48) {
+		if (likely(ioaddr->ctl_addr)) {
+			iowrite8(tf->ctl | ATA_HOB, ioaddr->ctl_addr);
+			tf->hob_feature = ioread8(ioaddr->error_addr);
+			tf->hob_feature = ioread8(ioaddr->error_addr);
+			tf->hob_nsect = ioread8(ioaddr->nsect_addr);
+			tf->hob_lbal = ioread8(ioaddr->lbal_addr);
+			tf->hob_lbam = ioread8(ioaddr->lbam_addr);
+			tf->hob_lbah = ioread8(ioaddr->lbah_addr);
+			iowrite8(tf->ctl, ioaddr->ctl_addr);
+			ap->last_ctl = tf->ctl;
+		} else
+			WARN_ON(1);
+	}
+}
+
 static struct ata_port_operations sch_pata_ops = {
 	.inherits		= &ata_bmdma_port_ops,
 	.cable_detect		= ata_cable_unknown,
 	.set_piomode		= sch_set_piomode,
 	.set_dmamode		= sch_set_dmamode,
+	.sff_tf_read		= sch_tf_read,	
 };
 
 static struct ata_port_info sch_port_info = {
Compulab's Linux support

chutz
Posts: 5
Joined: Wed Feb 10, 2010 4:26 am

Re: fit-pc2i HDD on Linux

Post by chutz »

Thanks, it works fine with that patch.

Are there any plans to push this patch upstream to the vanilla kernel?

Denis
Posts: 301
Joined: Sun Apr 26, 2009 3:24 pm

Re: fit-pc2i HDD on Linux

Post by Denis »

It will be fixed in the next HW revision of fitPC2i, it is not Linux kernel problem.
BTW slave disk detection works fine in Windows on current revision because of different detection procedure.
Compulab's Linux support

chutz
Posts: 5
Joined: Wed Feb 10, 2010 4:26 am

Re: fit-pc2i HDD on Linux

Post by chutz »

It's still a problem for people with the pilot run of fit-PC2i machines, so having the support in the vanilla kernel is still desirable (unless this can be fixed in BIOS?).

Would you have any objections to someone else sending this patch upstream?

Denis
Posts: 301
Joined: Sun Apr 26, 2009 3:24 pm

Re: fit-pc2i HDD on Linux

Post by Denis »

No, we have no plans to send this patch upstream.
If you want to use some non-Ubuntu distribution - you will need to apply this patch manually and recompile the kernel. Our preinstalled Ubuntu has this patch.
Compulab's Linux support

Mnemonic
Posts: 3
Joined: Mon Mar 08, 2010 12:54 pm

Re: Issue with Linux installation on fit-PC2i

Post by Mnemonic »

How can I apply this patch when booting on a live cd ex: Ubuntu Desktop 9.10?

axcoco
Posts: 34
Joined: Thu Apr 08, 2010 8:08 am

Re: Issue with Linux installation on fit-PC2i

Post by axcoco »

The thing is that dont really care about detection because we can mount the HDD in fstab and then do a mount /dev/sdb1 /media/hdd
Detection is needed with cd installation but we cant apply this patch
So this is useless for me. Still cant find any solution to install ubuntu server to HDD...

johan
Posts: 7
Joined: Thu May 20, 2010 9:05 am

Re: fit-pc2i HDD on Linux

Post by johan »

Denis wrote:It will be fixed in the next HW revision of fitPC2i, it is not Linux kernel problem.
BTW slave disk detection works fine in Windows on current revision because of different detection procedure.
I am a bit confused about this answer. You say its a hardware problem that will be fixed in the next HW revision, yet windows can detect it correctly? How can it then be a hardware problem? And how can a patch on the linux kernel make it work?

I got a fit pc2i with this problem. I ordered the diskless, wanting to install debian on it using pxe. I am guessing I will need to deploy a different strategy now.

-J

Post Reply

Return to “Linux on fit-PC2”