Example #1
0
int __init cf_init(void)
{
	pgprot_t prot;
	unsigned long paddrbase, psize;

	/* open I/O area window */
	paddrbase = virt_to_phys((void *)(PA_AREA5_IO+0x00000800));
	psize = PAGE_SIZE;
	prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_COM16);
	area5_io_base = p3_ioremap(paddrbase, psize, prot.pgprot);
	if (!area5_io_base) {
		printk("allocate_cf_area : can't open CF I/O window!\n");
		return -ENOMEM;
	}

	/* XXX : do we need attribute and common-memory area also? */

	paddrbase = virt_to_phys((void *)PA_AREA6_IO);
	psize = PAGE_SIZE;
	prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_COM16);
	area6_io_base = p3_ioremap(paddrbase, psize, prot.pgprot);
	if (!area6_io_base) {
		printk("allocate_cf_area : can't open Extention Bus window!\n");
		return -ENOMEM;
	}

	return 0;
}
Example #2
0
static int __init landisk_cf_init(void)
{
	pgprot_t prot;
	unsigned long paddrbase, psize;

	/* open I/O area window */
	paddrbase = virt_to_phys((void *)PA_AREA5_IO);
	psize = PAGE_SIZE;
	prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
	area5_io_base = p3_ioremap(paddrbase, psize, prot.pgprot);
	if (!area5_io_base) {
		printk("allocate_cf_area : can't open CF I/O window!\n");
		return -ENOMEM;
	}

	paddrbase = virt_to_phys((void *)PA_AREA6_IO);
	psize = PAGE_SIZE;
	prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16);
	area6_io_base = p3_ioremap(paddrbase, psize, prot.pgprot);
	if (!area6_io_base) {
		printk("allocate_cf_area : can't open HDD I/O window!\n");
		return -ENOMEM;
	}

	printk(KERN_INFO "Allocate Area5/6 success.\n");

	/* XXX : do we need attribute and common-memory area also? */

	return 0;
}
Example #3
0
static int __init lboxre2_devices_setup(void)
{
	u32 cf0_io_base;	/* Boot CF base address */
	pgprot_t prot;
	unsigned long paddrbase, psize;

	/* open I/O area window */
	paddrbase = virt_to_phys((void*)PA_AREA5_IO);
	psize = PAGE_SIZE;
	prot = PAGE_KERNEL_PCC( 1 , _PAGE_PCC_IO16);
	cf0_io_base = (u32)p3_ioremap(paddrbase, psize, prot.pgprot);
	if (!cf0_io_base) {
		printk(KERN_ERR "%s : can't open CF I/O window!\n" , __func__ );
		return -ENOMEM;
	}

	cf_ide_resources[0].start += cf0_io_base ;
	cf_ide_resources[0].end   += cf0_io_base ;
	cf_ide_resources[1].start += cf0_io_base ;
	cf_ide_resources[1].end   += cf0_io_base ;

	return platform_add_devices(lboxre2_devices,
			ARRAY_SIZE(lboxre2_devices));

}
Example #4
0
File: setup.c Project: 274914765/C
static int __init landisk_devices_setup(void)
{
    pgprot_t prot;
    unsigned long paddrbase;
    void *cf_ide_base;

    /* open I/O area window */
    paddrbase = virt_to_phys((void *)PA_AREA5_IO);
    prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_IO16);
    cf_ide_base = p3_ioremap(paddrbase, PAGE_SIZE, prot.pgprot);
    if (!cf_ide_base) {
        printk("allocate_cf_area : can't open CF I/O window!\n");
        return -ENOMEM;
    }

    /* IDE cmd address : 0x1f0-0x1f7 and 0x3f6 */
    cf_ide_resources[0].start = (unsigned long)cf_ide_base + 0x40;
    cf_ide_resources[0].end   = (unsigned long)cf_ide_base + 0x40 + 0x0f;
    cf_ide_resources[0].flags = IORESOURCE_IO;
    cf_ide_resources[1].start = (unsigned long)cf_ide_base + 0x2c;
    cf_ide_resources[1].end   = (unsigned long)cf_ide_base + 0x2c + 0x03;
    cf_ide_resources[1].flags = IORESOURCE_IO;
    cf_ide_resources[2].start = IRQ_FATA;
    cf_ide_resources[2].flags = IORESOURCE_IRQ;

    return platform_add_devices(landisk_devices,
                    ARRAY_SIZE(landisk_devices));
}
Example #5
0
int __init cf_init(void)
{
	pgprot_t prot;
	unsigned long paddrbase, psize;

	/* open I/O area window */
	paddrbase = virt_to_phys((void *)(PA_AREA5_IO+0x00000800));
	psize = PAGE_SIZE;
	prot = PAGE_KERNEL_PCC(1, _PAGE_PCC_COM16);
	area5_io16_base = p3_ioremap(paddrbase, psize, prot.pgprot);
	if (!area5_io16_base) {
		printk("allocate_cf_area : can't open CF I/O window!\n");
		return -ENOMEM;
	}

	/* XXX : do we need attribute and common-memory area also? */

	paddrbase = virt_to_phys((void *)PA_AREA6_IO);
	psize = PAGE_SIZE;
#if defined(CONFIG_HS7751RVOIP_CODEC)
	prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_COM8);
#else
	prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO8);
#endif
	area6_io8_base = p3_ioremap(paddrbase, psize, prot.pgprot);
	if (!area6_io8_base) {
		printk("allocate_cf_area : can't open CODEC I/O 8bit window!\n");
		return -ENOMEM;
	}
	prot = PAGE_KERNEL_PCC(0, _PAGE_PCC_IO16);
	area6_io16_base = p3_ioremap(paddrbase, psize, prot.pgprot);
	if (!area6_io16_base) {
		printk("allocate_cf_area : can't open CODEC I/O 16bit window!\n");
		return -ENOMEM;
	}

	return 0;
}
Example #6
0
static int __init allocate_cf_area(void)
{
	pgprot_t prot;
	unsigned long paddrbase, psize;

	/* open I/O area window */
	paddrbase = virt_to_phys((void*)CONFIG_CF_BASE_ADDR);
	psize = PAGE_SIZE;
	prot = PAGE_KERNEL_PCC(slot_no, _PAGE_PCC_IO16);
	cf_io_base = p3_ioremap(paddrbase, psize, prot.pgprot);
	if (!cf_io_base) {
		printk("allocate_cf_area : can't open CF I/O window!\n");
		return -ENOMEM;
	}
/*	printk("p3_ioremap(paddr=0x%08lx, psize=0x%08lx, prot=0x%08lx)=0x%08lx\n",
		paddrbase, psize, prot.pgprot, cf_io_base);*/

	/* XXX : do we need attribute and common-memory area also? */

	return 0;
}