@@ -253,6 +253,8 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[nfc_baud_gate], NULL, "imx27-nand.0");
clk_register_clkdev(clk[vpu_baud_gate], "per", "coda-imx27.0");
clk_register_clkdev(clk[vpu_ahb_gate], "ahb", "coda-imx27.0");
+ clk_register_clkdev(clk[sahara_ahb_gate], "ahb", "sahara-imx27.0");
+ clk_register_clkdev(clk[sahara_ipg_gate], "ipg", "sahara-imx27.0");
clk_register_clkdev(clk[dma_ahb_gate], "ahb", "imx27-dma");
clk_register_clkdev(clk[dma_ipg_gate], "ipg", "imx27-dma");
clk_register_clkdev(clk[fec_ipg_gate], "ipg", "imx27-fec.0");
@@ -20,6 +20,10 @@ extern const struct imx_imx27_coda_data imx27_coda_data;
#define imx27_add_coda() \
imx_add_imx27_coda(&imx27_coda_data)
+extern const struct imx_imx27_sahara_data imx27_sahara_data;
+#define imx27_add_sahara() \
+ imx_add_imx27_sahara(&imx27_sahara_data)
+
extern const struct imx_imx2_wdt_data imx27_imx2_wdt_data;
#define imx27_add_imx2_wdt() \
imx_add_imx2_wdt(&imx27_imx2_wdt_data)
@@ -20,6 +20,10 @@ config IMX_HAVE_PLATFORM_IMX27_CODA
bool
default y if SOC_IMX27
+config IMX_HAVE_PLATFORM_IMX27_SAHARA
+ bool
+ default y if SOC_IMX27
+
config IMX_HAVE_PLATFORM_IMX2_WDT
bool
@@ -7,6 +7,7 @@ obj-$(CONFIG_IMX_HAVE_PLATFORM_GPIO_KEYS) += platform-gpio_keys.o
obj-y += platform-gpio-mxc.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX21_HCD) += platform-imx21-hcd.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX27_CODA) += platform-imx27-coda.o
+obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX27_SAHARA) += platform-imx27-sahara.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMX2_WDT) += platform-imx2-wdt.o
obj-$(CONFIG_IMX_HAVE_PLATFORM_IMXDI_RTC) += platform-imxdi_rtc.o
obj-y += platform-imx-dma.o
@@ -91,6 +91,14 @@ struct imx_imx27_coda_data {
struct platform_device *__init imx_add_imx27_coda(
const struct imx_imx27_coda_data *data);
+struct imx_imx27_sahara_data {
+ resource_size_t iobase;
+ resource_size_t iosize;
+ resource_size_t irq;
+};
+struct platform_device *__init imx_add_imx27_sahara(
+ const struct imx_imx27_sahara_data *data);
+
struct imx_imx2_wdt_data {
int id;
resource_size_t iobase;
new file mode 100644
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2012 Vista Silicon
+ * Javier Martin <javier.martin@vista-silicon.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License version 2 as published by the
+ * Free Software Foundation.
+ */
+
+#include "../hardware.h"
+#include "devices-common.h"
+
+#ifdef CONFIG_SOC_IMX27
+const struct imx_imx27_sahara_data imx27_sahara_data __initconst = {
+ .iobase = MX27_SAHARA_BASE_ADDR,
+ .iosize = SZ_2K,
+ .irq = MX27_INT_SAHARA,
+};
+#endif
+
+struct platform_device *__init imx_add_imx27_sahara(
+ const struct imx_imx27_sahara_data *data)
+{
+ struct resource res[] = {
+ {
+ .start = data->iobase,
+ .end = data->iobase + data->iosize - 1,
+ .flags = IORESOURCE_MEM,
+ }, {
+ .start = data->irq,
+ .end = data->irq,
+ .flags = IORESOURCE_IRQ,
+ },
+ };
+ return imx_add_platform_device_dmamask("sahara-imx27", 0, res, 2, NULL,
+ 0, DMA_BIT_MASK(32));
+}
i.MX27 devices include this HW cryptographic accelerator. Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> --- arch/arm/mach-imx/clk-imx27.c | 2 ++ arch/arm/mach-imx/devices-imx27.h | 4 +++ arch/arm/mach-imx/devices/Kconfig | 4 +++ arch/arm/mach-imx/devices/Makefile | 1 + arch/arm/mach-imx/devices/devices-common.h | 8 +++++ arch/arm/mach-imx/devices/platform-imx27-sahara.c | 37 +++++++++++++++++++++ 6 files changed, 56 insertions(+) create mode 100644 arch/arm/mach-imx/devices/platform-imx27-sahara.c