[ARM] Kirkwood: platform device registration for the crypto engine
authorNicolas Pitre <nico@cam.org>
Wed, 3 Jun 2009 19:24:36 +0000 (15:24 -0400)
committerNicolas Pitre <nico@cam.org>
Mon, 8 Jun 2009 17:05:03 +0000 (13:05 -0400)
Signed-off-by: Nicolas Pitre <nico@marvell.com>
arch/arm/mach-kirkwood/common.c
arch/arm/mach-kirkwood/include/mach/kirkwood.h

index 3da32b1834dc278911c99bdd367250fa26c9cca3..0f6919838011cf2d6e8712f173ea1ef4064506ba 100644 (file)
@@ -560,6 +560,43 @@ void __init kirkwood_uart1_init(void)
 }
 
 
+/*****************************************************************************
+ * Cryptographic Engines and Security Accelerator (CESA)
+ ****************************************************************************/
+
+static struct resource kirkwood_crypto_res[] = {
+       {
+               .name   = "regs",
+               .start  = CRYPTO_PHYS_BASE,
+               .end    = CRYPTO_PHYS_BASE + 0xffff,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .name   = "sram",
+               .start  = KIRKWOOD_SRAM_PHYS_BASE,
+               .end    = KIRKWOOD_SRAM_PHYS_BASE + KIRKWOOD_SRAM_SIZE - 1,
+               .flags  = IORESOURCE_MEM,
+       }, {
+               .name   = "crypto interrupt",
+               .start  = IRQ_KIRKWOOD_CRYPTO,
+               .end    = IRQ_KIRKWOOD_CRYPTO,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct platform_device kirkwood_crypto_device = {
+       .name           = "mv_crypto",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(kirkwood_crypto_res),
+       .resource       = kirkwood_crypto_res,
+};
+
+void __init kirkwood_crypto_init(void)
+{
+       kirkwood_clk_ctrl |= CGC_CRYPTO;
+       platform_device_register(&kirkwood_crypto_device);
+}
+
+
 /*****************************************************************************
  * XOR
  ****************************************************************************/
@@ -886,6 +923,7 @@ void __init kirkwood_init(void)
        kirkwood_wdt_init();
        kirkwood_xor0_init();
        kirkwood_xor1_init();
+       kirkwood_crypto_init();
 }
 
 static int __init kirkwood_clock_gate(void)
index 2172224d7e2dae2fc95438198dce0c0302c1ec5b..07af858814a0dc418b0d50e68293d1d82ca2d4b9 100644 (file)
@@ -66,6 +66,8 @@
 
 #define BRIDGE_VIRT_BASE       (KIRKWOOD_REGS_VIRT_BASE | 0x20000)
 
+#define CRYPTO_PHYS_BASE       (KIRKWOOD_REGS_PHYS_BASE | 0x30000)
+
 #define PCIE_VIRT_BASE         (KIRKWOOD_REGS_VIRT_BASE | 0x40000)
 #define PCIE_LINK_CTRL         (PCIE_VIRT_BASE | 0x70)
 #define PCIE_STATUS            (PCIE_VIRT_BASE | 0x1a04)