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

Commit 660ffd6b authored by Mark A. Greer's avatar Mark A. Greer Committed by Paul Walmsley
Browse files

ARM: OMAP2xxx: hwmod: Convert AES crypto devcie data to hwmod



Convert the device data for the OMAP2 AES crypto IP from
explicit platform_data to hwmod.

CC: Paul Walmsley <paul@pwsan.com>
Signed-off-by: default avatarMark A. Greer <mgreer@animalcreek.com>
[paul@pwsan.com: fixed lines causing sparse warnings]
Signed-off-by: default avatarPaul Walmsley <paul@pwsan.com>
parent aec94bf5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1982,6 +1982,7 @@ static struct omap_clk omap2430_clks[] = {
	CLK("omap_rng", "ick",		&rng_ick),
	CLK(NULL,	"rng_ick",	&rng_ick),
	CLK("omap-aes",	"ick",	&aes_ick),
	CLK(NULL,	"aes_ick",	&aes_ick),
	CLK(NULL,	"pka_ick",	&pka_ick),
	CLK(NULL,	"usb_fck",	&usb_fck),
	CLK("musb-omap2430",	"ick",	&usbhs_ick),
+10 −25
Original line number Diff line number Diff line
@@ -519,28 +519,6 @@ static void __init omap_init_sham(void)

#if defined(CONFIG_CRYPTO_DEV_OMAP_AES) || defined(CONFIG_CRYPTO_DEV_OMAP_AES_MODULE)

#ifdef CONFIG_ARCH_OMAP2
static struct resource omap2_aes_resources[] = {
	{
		.start	= OMAP24XX_SEC_AES_BASE,
		.end	= OMAP24XX_SEC_AES_BASE + 0x4C,
		.flags	= IORESOURCE_MEM,
	},
	{
		.start	= OMAP24XX_DMA_AES_TX,
		.flags	= IORESOURCE_DMA,
	},
	{
		.start	= OMAP24XX_DMA_AES_RX,
		.flags	= IORESOURCE_DMA,
	}
};
static int omap2_aes_resources_sz = ARRAY_SIZE(omap2_aes_resources);
#else
#define omap2_aes_resources		NULL
#define omap2_aes_resources_sz		0
#endif

#ifdef CONFIG_ARCH_OMAP3
static struct resource omap3_aes_resources[] = {
	{
@@ -571,16 +549,23 @@ static struct platform_device aes_device = {
static void omap_init_aes(void)
{
	if (cpu_is_omap24xx()) {
		aes_device.resource = omap2_aes_resources;
		aes_device.num_resources = omap2_aes_resources_sz;
		struct omap_hwmod *oh;
		struct platform_device *pdev;

		oh = omap_hwmod_lookup("aes");
		if (!oh)
			return;

		pdev = omap_device_build("omap-aes", -1, oh, NULL, 0);
		WARN(IS_ERR(pdev), "Can't build omap_device for omap-aes\n");
	} else if (cpu_is_omap34xx()) {
		aes_device.resource = omap3_aes_resources;
		aes_device.num_resources = omap3_aes_resources_sz;
		platform_device_register(&aes_device);
	} else {
		pr_err("%s: platform not supported\n", __func__);
		return;
	}
	platform_device_register(&aes_device);
}

#else
+1 −0
Original line number Diff line number Diff line
@@ -611,6 +611,7 @@ static struct omap_hwmod_ocp_if *omap2420_hwmod_ocp_ifs[] __initdata = {
	&omap2420_l4_core__msdi1,
	&omap2xxx_l4_core__rng,
	&omap2xxx_l4_core__sham,
	&omap2xxx_l4_core__aes,
	&omap2420_l4_core__hdq1w,
	&omap2420_l4_wkup__counter_32k,
	&omap2420_l3__gpmc,
+1 −0
Original line number Diff line number Diff line
@@ -964,6 +964,7 @@ static struct omap_hwmod_ocp_if *omap2430_hwmod_ocp_ifs[] __initdata = {
	&omap2430_l4_core__hdq1w,
	&omap2xxx_l4_core__rng,
	&omap2xxx_l4_core__sham,
	&omap2xxx_l4_core__aes,
	&omap2430_l4_wkup__counter_32k,
	&omap2430_l3__gpmc,
	NULL,
+18 −0
Original line number Diff line number Diff line
@@ -147,6 +147,15 @@ static struct omap_hwmod_addr_space omap2xxx_sham_addrs[] = {
	{ }
};

static struct omap_hwmod_addr_space omap2xxx_aes_addrs[] = {
	{
		.pa_start	= 0x480a6000,
		.pa_end		= 0x480a6000 + 0x50 - 1,
		.flags		= ADDR_TYPE_RT
	},
	{ }
};

/*
 * Common interconnect data
 */
@@ -407,3 +416,12 @@ struct omap_hwmod_ocp_if omap2xxx_l4_core__sham = {
	.addr		= omap2xxx_sham_addrs,
	.user		= OCP_USER_MPU | OCP_USER_SDMA,
};

/* l4 core -> aes interface */
struct omap_hwmod_ocp_if omap2xxx_l4_core__aes = {
	.master		= &omap2xxx_l4_core_hwmod,
	.slave		= &omap2xxx_aes_hwmod,
	.clk		= "aes_ick",
	.addr		= omap2xxx_aes_addrs,
	.user		= OCP_USER_MPU | OCP_USER_SDMA,
};
Loading