Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1d5a1a6e authored by Saeed Bishara's avatar Saeed Bishara Committed by Lennert Buytenhek
Browse files

[ARM] Orion: Instantiate mv_xor driver for 5182

parent 3af6b044
Loading
Loading
Loading
Loading
+98 −0
Original line number Original line Diff line number Diff line
@@ -27,6 +27,7 @@
#include <mach/hardware.h>
#include <mach/hardware.h>
#include <mach/orion5x.h>
#include <mach/orion5x.h>
#include <plat/ehci-orion.h>
#include <plat/ehci-orion.h>
#include <plat/mv_xor.h>
#include <plat/orion_nand.h>
#include <plat/orion_nand.h>
#include <plat/time.h>
#include <plat/time.h>
#include "common.h"
#include "common.h"
@@ -354,6 +355,103 @@ void __init orion5x_uart1_init(void)
}
}




/*****************************************************************************
 * XOR engine
 ****************************************************************************/
static struct resource orion5x_xor_shared_resources[] = {
	{
		.name	= "xor low",
		.start	= ORION5X_XOR_PHYS_BASE,
		.end	= ORION5X_XOR_PHYS_BASE + 0xff,
		.flags	= IORESOURCE_MEM,
	}, {
		.name	= "xor high",
		.start	= ORION5X_XOR_PHYS_BASE + 0x200,
		.end	= ORION5X_XOR_PHYS_BASE + 0x2ff,
		.flags	= IORESOURCE_MEM,
	},
};

static struct platform_device orion5x_xor_shared = {
	.name		= MV_XOR_SHARED_NAME,
	.id		= 0,
	.num_resources	= ARRAY_SIZE(orion5x_xor_shared_resources),
	.resource	= orion5x_xor_shared_resources,
};

static u64 orion5x_xor_dmamask = DMA_32BIT_MASK;

static struct resource orion5x_xor0_resources[] = {
	[0] = {
		.start	= IRQ_ORION5X_XOR0,
		.end	= IRQ_ORION5X_XOR0,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct mv_xor_platform_data orion5x_xor0_data = {
	.shared		= &orion5x_xor_shared,
	.hw_id		= 0,
	.pool_size	= PAGE_SIZE,
};

static struct platform_device orion5x_xor0_channel = {
	.name		= MV_XOR_NAME,
	.id		= 0,
	.num_resources	= ARRAY_SIZE(orion5x_xor0_resources),
	.resource	= orion5x_xor0_resources,
	.dev		= {
		.dma_mask		= &orion5x_xor_dmamask,
		.coherent_dma_mask	= DMA_64BIT_MASK,
		.platform_data		= (void *)&orion5x_xor0_data,
	},
};

static struct resource orion5x_xor1_resources[] = {
	[0] = {
		.start	= IRQ_ORION5X_XOR1,
		.end	= IRQ_ORION5X_XOR1,
		.flags	= IORESOURCE_IRQ,
	},
};

static struct mv_xor_platform_data orion5x_xor1_data = {
	.shared		= &orion5x_xor_shared,
	.hw_id		= 1,
	.pool_size	= PAGE_SIZE,
};

static struct platform_device orion5x_xor1_channel = {
	.name		= MV_XOR_NAME,
	.id		= 1,
	.num_resources	= ARRAY_SIZE(orion5x_xor1_resources),
	.resource	= orion5x_xor1_resources,
	.dev		= {
		.dma_mask		= &orion5x_xor_dmamask,
		.coherent_dma_mask	= DMA_64BIT_MASK,
		.platform_data		= (void *)&orion5x_xor1_data,
	},
};

void __init orion5x_xor_init(void)
{
	platform_device_register(&orion5x_xor_shared);

	/*
	 * two engines can't do memset simultaneously, this limitation
	 * satisfied by removing memset support from one of the engines.
	 */
	dma_cap_set(DMA_MEMCPY, orion5x_xor0_data.cap_mask);
	dma_cap_set(DMA_XOR, orion5x_xor0_data.cap_mask);
	platform_device_register(&orion5x_xor0_channel);

	dma_cap_set(DMA_MEMCPY, orion5x_xor1_data.cap_mask);
	dma_cap_set(DMA_MEMSET, orion5x_xor1_data.cap_mask);
	dma_cap_set(DMA_XOR, orion5x_xor1_data.cap_mask);
	platform_device_register(&orion5x_xor1_channel);
}


/*****************************************************************************
/*****************************************************************************
 * Time handling
 * Time handling
 ****************************************************************************/
 ****************************************************************************/
+1 −0
Original line number Original line Diff line number Diff line
@@ -32,6 +32,7 @@ void orion5x_i2c_init(void);
void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
void orion5x_sata_init(struct mv_sata_platform_data *sata_data);
void orion5x_uart0_init(void);
void orion5x_uart0_init(void);
void orion5x_uart1_init(void);
void orion5x_uart1_init(void);
void orion5x_xor_init(void);


/*
/*
 * PCIe/PCI functions.
 * PCIe/PCI functions.
+4 −0
Original line number Original line Diff line number Diff line
@@ -106,6 +106,10 @@
#define ORION5X_USB0_VIRT_BASE		(ORION5X_REGS_VIRT_BASE | 0x50000)
#define ORION5X_USB0_VIRT_BASE		(ORION5X_REGS_VIRT_BASE | 0x50000)
#define ORION5X_USB0_REG(x)		(ORION5X_USB0_VIRT_BASE | (x))
#define ORION5X_USB0_REG(x)		(ORION5X_USB0_VIRT_BASE | (x))


#define ORION5X_XOR_PHYS_BASE		(ORION5X_REGS_PHYS_BASE | 0x60900)
#define ORION5X_XOR_VIRT_BASE		(ORION5X_REGS_VIRT_BASE | 0x60900)
#define ORION5X_XOR_REG(x)		(ORION5X_XOR_VIRT_BASE | (x))

#define ORION5X_ETH_PHYS_BASE		(ORION5X_REGS_PHYS_BASE | 0x70000)
#define ORION5X_ETH_PHYS_BASE		(ORION5X_REGS_PHYS_BASE | 0x70000)
#define ORION5X_ETH_VIRT_BASE		(ORION5X_REGS_VIRT_BASE | 0x70000)
#define ORION5X_ETH_VIRT_BASE		(ORION5X_REGS_VIRT_BASE | 0x70000)
#define ORION5X_ETH_REG(x)		(ORION5X_ETH_VIRT_BASE | (x))
#define ORION5X_ETH_REG(x)		(ORION5X_ETH_VIRT_BASE | (x))
+1 −0
Original line number Original line Diff line number Diff line
@@ -356,6 +356,7 @@ static void __init kurobox_pro_init(void)
	orion5x_sata_init(&kurobox_pro_sata_data);
	orion5x_sata_init(&kurobox_pro_sata_data);
	orion5x_uart0_init();
	orion5x_uart0_init();
	orion5x_uart1_init();
	orion5x_uart1_init();
	orion5x_xor_init();


	orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE,
	orion5x_setup_dev_boot_win(KUROBOX_PRO_NOR_BOOT_BASE,
				   KUROBOX_PRO_NOR_BOOT_SIZE);
				   KUROBOX_PRO_NOR_BOOT_SIZE);
+1 −0
Original line number Original line Diff line number Diff line
@@ -239,6 +239,7 @@ static void __init mss2_init(void)
	orion5x_i2c_init();
	orion5x_i2c_init();
	orion5x_sata_init(&mss2_sata_data);
	orion5x_sata_init(&mss2_sata_data);
	orion5x_uart0_init();
	orion5x_uart0_init();
	orion5x_xor_init();


	orion5x_setup_dev_boot_win(MSS2_NOR_BOOT_BASE, MSS2_NOR_BOOT_SIZE);
	orion5x_setup_dev_boot_win(MSS2_NOR_BOOT_BASE, MSS2_NOR_BOOT_SIZE);
	platform_device_register(&mss2_nor_flash);
	platform_device_register(&mss2_nor_flash);
Loading