[pasemi] Internal CompactFlash (CF) card device not recognised after the powerpc-4.8-1 merge

Christian Zigotzky chzigotzky at xenosoft.de
Sat Aug 6 00:38:17 AEST 2016


Hi All,

I have found some information about the electra IDE CF card device: 
http://linuxppc-dev.ozlabs.narkive.com/kxQRFqGe/patch-pasemi-electra-ide-pata-platform-glue

I checked the kernel config and the merge but without any success.

Cheers,

Christian

On 05 August 2016 at 1:41 PM, Christian Zigotzky wrote:
> Hi All,
>
> The internal PASEMI CompactFlash (CF) card device doesn't work anymore 
> after the powerpc-4.8-1 merge. That means the code for the internal CF 
> card device in the Nemo patch doesn't work after the first PowerPC 
> merge. The CompactFlash (CF) card slot is wired to the CPU local bus. 
> It is typically used to hold the Linux kernel. I know it isn't well to 
> use an own patch for that but I think it is a good time to integrate 
> the PASEMI internal CompactFlash (CF) card device to the official 
> kernel. What do you think? I am not a programmer so I can't integrate 
> the source code for the internal CF card device. But maybe you can 
> take the patch and integrate it.
>
> We use the following patch for the kernel 4.7:
>
>     diff -rupN a/drivers/ata/pata_of_platform.c 
> b/drivers/ata/pata_of_platform.c
>     --- a/drivers/ata/pata_of_platform.c   2016-08-05 
> 09:58:41.410569036 +0200
>     +++ b/drivers/ata/pata_of_platform.c   2016-08-05 
> 09:59:54.414288884 +0200
>     @@ -41,14 +41,36 @@ static int pata_of_platform_probe(struct
>            return -EINVAL;
>         }
>
>     -   ret = of_address_to_resource(dn, 1, &ctl_res);
>     -   if (ret) {
>     -      dev_err(&ofdev->dev, "can't get CTL address from "
>     -         "device tree\n");
>     -      return -EINVAL;
>     +   if (of_device_is_compatible(dn, "electra-ide")) {
>     +      /* Altstatus is really at offset 0x3f6 from the primary window
>     +       * on electra-ide. Adjust ctl_res and io_res accordingly.
>     +       */
>     +      ctl_res = io_res;
>     +      ctl_res.start = ctl_res.start+0x3f6;
>     +      io_res.end = ctl_res.start-1;
>     +
>     +#ifdef CONFIG_PPC_PASEMI_SB600
>     +       } else if (of_device_is_compatible(dn, "electra-cf")) {
>     +               /* Task regs are at 0x800, with alt status @ 0x80e 
> in the primary window
>     +                * on electra-cf. Adjust ctl_res and io_res 
> accordingly.
>     +                */
>     +               ctl_res = io_res;
>     +               io_res.start += 0x800;
>     +               ctl_res.start = ctl_res.start + 0x80e;
>     +               io_res.end = ctl_res.start-1;
>     +#endif
>     +   } else {
>     +      ret = of_address_to_resource(dn, 1, &ctl_res);
>     +      if (ret) {
>     +         dev_err(&ofdev->dev, "can't get CTL address from "
>     +            "device tree\n");
>     +         return -EINVAL;
>     +      }
>         }
>
>         irq_res = platform_get_resource(ofdev, IORESOURCE_IRQ, 0);
>     +   if (irq_res)
>     +      irq_res->flags = 0;
>
>         prop = of_get_property(dn, "reg-shift", NULL);
>         if (prop)
>     @@ -65,6 +87,11 @@ static int pata_of_platform_probe(struct
>            dev_info(&ofdev->dev, "pio-mode unspecified, assuming 
> PIO0\n");
>         }
>
>     +#ifdef CONFIG_PPC_PASEMI_SB600
>     +       irq_res = 0;                    // force irq off (doesn't 
> seem to work)
>     +#endif
>     +
>     +
>         pio_mask = 1 << pio_mode;
>         pio_mask |= (1 << pio_mode) - 1;
>
>     @@ -74,7 +101,11 @@ static int pata_of_platform_probe(struct
>
>      static struct of_device_id pata_of_platform_match[] = {
>         { .compatible = "ata-generic", },
>     -   { },
>     +   { .compatible = "electra-ide", },
>     +#ifdef CONFIG_PPC_PASEMI_SB600
>     +       { .compatible = "electra-cf",},
>     +#endif
>     +   {},
>      };
>      MODULE_DEVICE_TABLE(of, pata_of_platform_match);
>
> dmesg with the kernel 4.7:
>
> zcat /var/log/dmesg.1.gz | grep -i ata7
>
>     [    2.939788] ata7: PATA max PIO0 no IRQ, using PIO polling mmio 
> cmd 0xf0000800 ctl 0xf000080e
>     [    3.099186] ata7.00: CFA: SanDisk SDCFB-256, HDX 2.33, max PIO4
>     [    3.099191] ata7.00: 501760 sectors, multi 0: LBA
>     [    3.099199] ata7.00: configured for PIO
>
> The dmesg of the latest Git kernel doesn't have any output of our 
> internal CF card device.
>
> Could you please integrate our PASEMI CF card device again?
>
> Thanks,
>
> Christian
>
>



More information about the Linuxppc-dev mailing list