View unanswered posts | View active topics It is currently Fri Sep 21, 2018 3:40 am



Reply to topic  [ 7 posts ] 
 needing kernel patch for FitPC2i rev. 1.1 
Author Message

Joined: Tue Feb 09, 2010 11:40 am
Posts: 20
Post needing kernel patch for FitPC2i rev. 1.1
Hi,
I've got a FitPC2i rev. 1.1 down in my cellar which runs fine under Ubuntu 10.04 LTS - with kernel 2.6.35.
Now that the next LTS Ubuntu release is due, I'd like to upgrade too - but there's a problem: That rev. 1.1 model got the hardware quirks which hinders the stock ubuntu kernel from finding my SATA disk.
A little back in time there was a patch available somewhere in the forum or the FitPC wiki, but I can't find it anymore. Back then the forum user axcoco provided an ISO with a patched kernel, but his server doesn't contain any files anymore :(

So - can someone from CompuLab please share the relevant patch code for the pata_sch.c file? And I'd appreciate if it worked with the 3.2 kernel that comes with Ubuntu 12.04 :D

Thanks in advance,

Merhaba


Fri Feb 24, 2012 9:57 pm
Profile

Joined: Sun Apr 26, 2009 3:24 pm
Posts: 295
Post Re: needing kernel patch for FitPC2i rev. 1.1
Hi, here is the patch. It has not been changed since 2.6.31 kernel.

Code:
--- drivers/ata/pata_sch.c   2012-02-07 15:14:52.000000000 +0200
+++ drivers/ata/pata_sch.c   2012-02-26 10:31:07.314325150 +0200
@@ -75,13 +75,55 @@
    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;
+
+   tf->command = ata_sff_check_status(ap);
+   tf->feature = ioread8(ioaddr->error_addr);
+
+   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_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 = {
    .flags      = ATA_FLAG_SLAVE_POSS,
    .pio_mask   = ATA_PIO4,

_________________
Compulab's Linux support


Sun Feb 26, 2012 8:41 am
Profile

Joined: Tue Feb 09, 2010 11:40 am
Posts: 20
Post Re: needing kernel patch for FitPC2i rev. 1.1
Thanks a lot :D


Wed Feb 29, 2012 9:08 pm
Profile

Joined: Tue Feb 09, 2010 11:40 am
Posts: 20
Post Re: needing kernel patch for FitPC2i rev. 1.1
Hi Denis,
took me a while to try and apply the patch to the latest sources in precise repos, but my patch program keeps complaining that the patch you posted was malformed. I invoked patch with this command:
Code:
patch --dry-run -F 10 -i ../../pata_sch-for-fitpc2i-rev1.1.patch
patch: **** malformed patch at line 5: };

Lokks like patch would like a few more lines of context to me.
Could you provide a patch with a few more lines of context above the inesertion point?
Code:
diff -u 10 <files>


should do the job I think.

Thanks :D


Sat Mar 17, 2012 10:32 pm
Profile

Joined: Tue Feb 09, 2010 11:40 am
Posts: 20
Post Re: needing kernel patch for FitPC2i rev. 1.1
Hm, didn't get a reply for this. Just in case others have this problem too:
Looks like the pasted code lacks a space in front of the non-patched context codelines. This at least helped me get rid of the malformed patch error.
Had to patch manually nevertheless :-/


Fri Mar 29, 2013 12:09 pm
Profile

Joined: Tue Feb 09, 2010 11:40 am
Posts: 20
Post Re: needing kernel patch for FitPC2i rev. 1.1
Here's a working patch I made today. Patches flawlessly using the command
Code:
patch -u -p0 fitpci_hdd_fix.txt
on my Ubuntu 10.04 box

Sorry for linking, but the board won't allow my to upload the diff. I'll try and keep it available.


Fri Mar 29, 2013 4:01 pm
Profile
Site Admin

Joined: Thu Jun 02, 2011 1:13 pm
Posts: 1260
Post Re: needing kernel patch for FitPC2i rev. 1.1
You should zip your files if you want to attach them to your post.

_________________
Gabriel Heifets

Fit-PC2/3/IntensePC support.


Tue Apr 02, 2013 2:39 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 7 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.