]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge branch 'next/boards' into for-next
authorKevin Hilman <khilman@linaro.org>
Mon, 14 Oct 2013 22:47:03 +0000 (15:47 -0700)
committerKevin Hilman <khilman@linaro.org>
Mon, 14 Oct 2013 22:47:34 +0000 (15:47 -0700)
* next/boards:
  ARM: OMAP2+: display: Create omap_vout device inside omap_display_init
  ARM: OMAP2+: display: Create omapvrfb and omapfb devices inside omap_display_init
  ARM: OMAP2+: display: Create omapdrm device inside omap_display_init
  ARM: OMAP2+: drm: Don't build device for DMM
  RX-51: Add support for OMAP3 ROM Random Number Generator
  ARM: OMAP3: RX-51: ARM errata 430973 workaround
  ARM: OMAP3: Add secure function omap_smc3() which calling instruction smc #1

Signed-off-by: Kevin Hilman <khilman@linaro.org>
13 files changed:
arch/arm/arm-soc-for-next-contents.txt
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/board-rx51-peripherals.c
arch/arm/mach-omap2/board-rx51.c
arch/arm/mach-omap2/cclock3xxx_data.c
arch/arm/mach-omap2/devices.c
arch/arm/mach-omap2/display.c
arch/arm/mach-omap2/display.h
arch/arm/mach-omap2/drm.c
arch/arm/mach-omap2/fb.c
arch/arm/mach-omap2/omap-secure.c
arch/arm/mach-omap2/omap-secure.h
arch/arm/mach-omap2/omap-smc.S

index b3c01275eca0b3c98aa979e0483cdba9e6ca0b8f..c2ed874ca78c7ac4d2a667bfd711070edcc92048 100644 (file)
@@ -54,6 +54,8 @@ next/boards
                git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-defconfig-for-v3.13
        renesas/boards2
                git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git tags/renesas-boards2-for-v3.13
+       omap/boards
+               git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap tags/omap-for-v3.13/board-signed
 
 next/dt
        samsung/s3c64xx-dt
index f8d4a1b83864e3488980957e24e2822acf7b6d32..0e95f48f1c052618e1cc75b3e42c40fa0f6f7193 100644 (file)
@@ -8,7 +8,7 @@ ccflags-$(CONFIG_ARCH_MULTIPLATFORM) := -I$(srctree)/$(src)/include \
 # Common support
 obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
         common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
-        omap_device.o sram.o
+        omap_device.o sram.o drm.o
 
 omap-2-3-common                                = irq.o
 hwmod-common                           = omap_hwmod.o omap_hwmod_reset.o \
@@ -228,10 +228,6 @@ endif
 # OMAP2420 MSDI controller integration support ("MMC")
 obj-$(CONFIG_SOC_OMAP2420)             += msdi.o
 
-ifneq ($(CONFIG_DRM_OMAP),)
-obj-y                                  += drm.o
-endif
-
 # Specific board support
 obj-$(CONFIG_MACH_OMAP_GENERIC)                += board-generic.o pdata-quirks.o
 obj-$(CONFIG_MACH_OMAP_H4)             += board-h4.o
index f6fe388af9895ef8c8b2859f9177a146a30fb965..5c0d0e12042099876be304992f66bc6934fb7ea4 100644 (file)
@@ -57,6 +57,8 @@
 #include "common-board-devices.h"
 #include "gpmc.h"
 #include "gpmc-onenand.h"
+#include "soc.h"
+#include "omap-secure.h"
 
 #define SYSTEM_REV_B_USES_VAUX3        0x1699
 #define SYSTEM_REV_S_USES_VAUX3 0x8
@@ -1298,6 +1300,22 @@ static void __init rx51_init_twl4030_hwmon(void)
        platform_device_register(&madc_hwmon);
 }
 
+static struct platform_device omap3_rom_rng_device = {
+       .name           = "omap3-rom-rng",
+       .id             = -1,
+       .dev    = {
+               .platform_data  = rx51_secure_rng_call,
+       },
+};
+
+static void __init rx51_init_omap3_rom_rng(void)
+{
+       if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
+               pr_info("RX-51: Registring OMAP3 HWRNG device\n");
+               platform_device_register(&omap3_rom_rng_device);
+       }
+}
+
 void __init rx51_peripherals_init(void)
 {
        rx51_i2c_init();
@@ -1318,5 +1336,6 @@ void __init rx51_peripherals_init(void)
 
        rx51_charger_init();
        rx51_init_twl4030_hwmon();
+       rx51_init_omap3_rom_rng();
 }
 
index 7735105561d87dd218c436b357ade5211e5a6d2e..db168c9627a15e2ba5d0ea11bf02001cc73b83ff 100644 (file)
@@ -2,6 +2,8 @@
  * Board support file for Nokia N900 (aka RX-51).
  *
  * Copyright (C) 2007, 2008 Nokia
+ * Copyright (C) 2012 Ivaylo Dimitrov <freemangordon@abv.bg>
+ * Copyright (C) 2013 Pali Rohár <pali.rohar@gmail.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
@@ -31,7 +33,9 @@
 #include "mux.h"
 #include "gpmc.h"
 #include "pm.h"
+#include "soc.h"
 #include "sdram-nokia.h"
+#include "omap-secure.h"
 
 #define RX51_GPIO_SLEEP_IND 162
 
@@ -103,6 +107,14 @@ static void __init rx51_init(void)
        usb_musb_init(&musb_board_data);
        rx51_peripherals_init();
 
+       if (omap_type() == OMAP2_DEVICE_TYPE_SEC) {
+#ifdef CONFIG_ARM_ERRATA_430973
+               pr_info("RX-51: Enabling ARM errata 430973 workaround\n");
+               /* set IBE to 1 */
+               rx51_secure_update_aux_cr(BIT(6), 0);
+#endif
+       }
+
        /* Ensure SDRC pins are mux'd for self-refresh */
        omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
        omap_mux_init_signal("sdrc_cke1", OMAP_PIN_OUTPUT);
index 334b76745900fb397e8d3fd5419dc1dd91e0bc63..03a2829beb8e4c69144dfd5e5eb639189b836b02 100644 (file)
@@ -3275,6 +3275,7 @@ static struct omap_clk omap36xx_clks[] = {
 static struct omap_clk omap34xx_omap36xx_clks[] = {
        CLK(NULL,       "aes1_ick",     &aes1_ick),
        CLK("omap_rng", "ick",          &rng_ick),
+       CLK("omap3-rom-rng",    "ick",  &rng_ick),
        CLK(NULL,       "sha11_ick",    &sha11_ick),
        CLK(NULL,       "des1_ick",     &des1_ick),
        CLK(NULL,       "cam_mclk",     &cam_mclk),
index 5336c75926cdc8ff23c100c134bb44a0fa4f25df..0dd6398bade4787510c4d5c62210b7a61cfb7595 100644 (file)
@@ -36,6 +36,7 @@
 #include "mux.h"
 #include "control.h"
 #include "devices.h"
+#include "display.h"
 
 #define L3_MODULES_MAX_LEN 12
 #define L3_MODULES 3
@@ -465,13 +466,13 @@ static struct platform_device omap_vout_device = {
        .resource       = &omap_vout_resource[0],
        .id             = -1,
 };
-static void omap_init_vout(void)
+
+int __init omap_init_vout(void)
 {
-       if (platform_device_register(&omap_vout_device) < 0)
-               printk(KERN_ERR "Unable to register OMAP-VOUT device\n");
+       return platform_device_register(&omap_vout_device);
 }
 #else
-static inline void omap_init_vout(void) {}
+int __init omap_init_vout(void) { return 0; }
 #endif
 
 /*-------------------------------------------------------------------------*/
@@ -498,7 +499,6 @@ static int __init omap2_init_devices(void)
                omap_init_rng();
        }
        omap_init_sti();
-       omap_init_vout();
 
        return 0;
 }
index 03a0516c7f678294d1f7a261901a61550c0f012a..a4e536b11ec9a997d8e640ff44745e6759c031fa 100644 (file)
@@ -416,6 +416,34 @@ int __init omap_display_init(struct omap_dss_board_info *board_data)
                }
        }
 
+       /* create DRM device */
+       r = omap_init_drm();
+       if (r < 0) {
+               pr_err("Unable to register omapdrm device\n");
+               return r;
+       }
+
+       /* create vrfb device */
+       r = omap_init_vrfb();
+       if (r < 0) {
+               pr_err("Unable to register omapvrfb device\n");
+               return r;
+       }
+
+       /* create FB device */
+       r = omap_init_fb();
+       if (r < 0) {
+               pr_err("Unable to register omapfb device\n");
+               return r;
+       }
+
+       /* create V4L2 display device */
+       r = omap_init_vout();
+       if (r < 0) {
+               pr_err("Unable to register omap_vout device\n");
+               return r;
+       }
+
        return 0;
 }
 
index b871b017b3522bc0bf61d9837efbf93bbdfd1111..f3d2ce4bc262350420d8ff57eb4805d2894ff87a 100644 (file)
@@ -26,4 +26,8 @@ struct omap_dss_dispc_dev_attr {
        bool    has_framedonetv_irq;
 };
 
+int omap_init_drm(void);
+int omap_init_vrfb(void);
+int omap_init_fb(void);
+int omap_init_vout(void);
 #endif
index 59a4af779f421986fc6ea097cf1f33040bdaadf7..facd7406a03d76b2643802e8fb8759c54ec729c7 100644 (file)
 #include <linux/platform_data/omap_drm.h>
 
 #include "soc.h"
-#include "omap_device.h"
-#include "omap_hwmod.h"
+#include "display.h"
 
-#if defined(CONFIG_DRM_OMAP) || (CONFIG_DRM_OMAP_MODULE)
+#if defined(CONFIG_DRM_OMAP) || defined(CONFIG_DRM_OMAP_MODULE)
 
 static struct omap_drm_platform_data platform_data;
 
@@ -42,26 +41,13 @@ static struct platform_device omap_drm_device = {
        .id = 0,
 };
 
-static int __init omap_init_drm(void)
+int __init omap_init_drm(void)
 {
-       struct omap_hwmod *oh = NULL;
-       struct platform_device *pdev;
-
-       /* lookup and populate the DMM information, if present - OMAP4+ */
-       oh = omap_hwmod_lookup("dmm");
-
-       if (oh) {
-               pdev = omap_device_build(oh->name, -1, oh, NULL, 0);
-               WARN(IS_ERR(pdev), "Could not build omap_device for %s\n",
-                       oh->name);
-       }
-
        platform_data.omaprev = GET_OMAP_TYPE;
 
        return platform_device_register(&omap_drm_device);
 
 }
-
-omap_arch_initcall(omap_init_drm);
-
+#else
+int __init omap_init_drm(void) { return 0; }
 #endif
index 2ca33cc0c484055a7c4f6543b9c2a1e35adeef87..26e28e94f62582d09b77134aca1ec2533b148856 100644 (file)
@@ -32,6 +32,7 @@
 #include <asm/mach/map.h>
 
 #include "soc.h"
+#include "display.h"
 
 #ifdef CONFIG_OMAP2_VRFB
 
@@ -64,7 +65,7 @@ static const struct resource omap3_vrfb_resources[] = {
        DEFINE_RES_MEM_NAMED(0xfc000000u, 0x4000000, "vrfb-area-11"),
 };
 
-static int __init omap_init_vrfb(void)
+int __init omap_init_vrfb(void)
 {
        struct platform_device *pdev;
        const struct resource *res;
@@ -85,8 +86,8 @@ static int __init omap_init_vrfb(void)
 
        return PTR_RET(pdev);
 }
-
-omap_arch_initcall(omap_init_vrfb);
+#else
+int __init omap_init_vrfb(void) { return 0; }
 #endif
 
 #if defined(CONFIG_FB_OMAP2) || defined(CONFIG_FB_OMAP2_MODULE)
@@ -105,11 +106,10 @@ static struct platform_device omap_fb_device = {
        .num_resources = 0,
 };
 
-static int __init omap_init_fb(void)
+int __init omap_init_fb(void)
 {
        return platform_device_register(&omap_fb_device);
 }
-
-omap_arch_initcall(omap_init_fb);
-
+#else
+int __init omap_init_fb(void) { return 0; }
 #endif
index b970440cffca0b5484c90dd7b6e08c7caf5b6bc2..5ac122e88f678b75d6c1060783738321d8b9c579 100644 (file)
@@ -3,6 +3,8 @@
  *
  * Copyright (C) 2011 Texas Instruments, Inc.
  *     Santosh Shilimkar <santosh.shilimkar@ti.com>
+ * Copyright (C) 2012 Ivaylo Dimitrov <freemangordon@abv.bg>
+ * Copyright (C) 2013 Pali Rohár <pali.rohar@gmail.com>
  *
  *
  * This program is free software,you can redistribute it and/or modify
@@ -70,3 +72,77 @@ phys_addr_t omap_secure_ram_mempool_base(void)
 {
        return omap_secure_memblock_base;
 }
+
+/**
+ * rx51_secure_dispatcher: Routine to dispatch secure PPA API calls
+ * @idx: The PPA API index
+ * @process: Process ID
+ * @flag: The flag indicating criticality of operation
+ * @nargs: Number of valid arguments out of four.
+ * @arg1, arg2, arg3 args4: Parameters passed to secure API
+ *
+ * Return the non-zero error value on failure.
+ *
+ * NOTE: rx51_secure_dispatcher differs from omap_secure_dispatcher because
+ *       it calling omap_smc3() instead omap_smc2() and param[0] is nargs+1
+ */
+u32 rx51_secure_dispatcher(u32 idx, u32 process, u32 flag, u32 nargs,
+                          u32 arg1, u32 arg2, u32 arg3, u32 arg4)
+{
+       u32 ret;
+       u32 param[5];
+
+       param[0] = nargs+1; /* RX-51 needs number of arguments + 1 */
+       param[1] = arg1;
+       param[2] = arg2;
+       param[3] = arg3;
+       param[4] = arg4;
+
+       /*
+        * Secure API needs physical address
+        * pointer for the parameters
+        */
+       local_irq_disable();
+       local_fiq_disable();
+       flush_cache_all();
+       outer_clean_range(__pa(param), __pa(param + 5));
+       ret = omap_smc3(idx, process, flag, __pa(param));
+       flush_cache_all();
+       local_fiq_enable();
+       local_irq_enable();
+
+       return ret;
+}
+
+/**
+ * rx51_secure_update_aux_cr: Routine to modify the contents of Auxiliary Control Register
+ *  @set_bits: bits to set in ACR
+ *  @clr_bits: bits to clear in ACR
+ *
+ * Return the non-zero error value on failure.
+*/
+u32 rx51_secure_update_aux_cr(u32 set_bits, u32 clear_bits)
+{
+       u32 acr;
+
+       /* Read ACR */
+       asm volatile ("mrc p15, 0, %0, c1, c0, 1" : "=r" (acr));
+       acr &= ~clear_bits;
+       acr |= set_bits;
+
+       return rx51_secure_dispatcher(RX51_PPA_WRITE_ACR,
+                                     0,
+                                     FLAG_START_CRITICAL,
+                                     1, acr, 0, 0, 0);
+}
+
+/**
+ * rx51_secure_rng_call: Routine for HW random generator
+ */
+u32 rx51_secure_rng_call(u32 ptr, u32 count, u32 flag)
+{
+       return rx51_secure_dispatcher(RX51_PPA_HWRNG,
+                                     0,
+                                     NO_FLAG,
+                                     3, ptr, count, flag, 0);
+}
index a5ee09d20ac983bc64f00e55f192063a8b86b695..8cc7d331437d844a3b0ba5b3d2afb844b2de5d06 100644 (file)
@@ -3,6 +3,8 @@
  *
  * Copyright (C) 2011 Texas Instruments, Inc.
  *     Santosh Shilimkar <santosh.shilimkar@ti.com>
+ * Copyright (C) 2012 Ivaylo Dimitrov <freemangordon@abv.bg>
+ * Copyright (C) 2013 Pali Rohár <pali.rohar@gmail.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
 #define OMAP4_PPA_L2_POR_INDEX         0x23
 #define OMAP4_PPA_CPU_ACTRL_SMP_INDEX  0x25
 
+/* Secure RX-51 PPA (Primary Protected Application) APIs */
+#define RX51_PPA_HWRNG                 29
+#define RX51_PPA_L2_INVAL              40
+#define RX51_PPA_WRITE_ACR             42
+
 #ifndef __ASSEMBLER__
 
 extern u32 omap_secure_dispatcher(u32 idx, u32 flag, u32 nargs,
                                u32 arg1, u32 arg2, u32 arg3, u32 arg4);
 extern u32 omap_smc2(u32 id, u32 falg, u32 pargs);
+extern u32 omap_smc3(u32 id, u32 process, u32 flag, u32 pargs);
 extern phys_addr_t omap_secure_ram_mempool_base(void);
 extern int omap_secure_ram_reserve_memblock(void);
 
+extern u32 rx51_secure_dispatcher(u32 idx, u32 process, u32 flag, u32 nargs,
+                                 u32 arg1, u32 arg2, u32 arg3, u32 arg4);
+extern u32 rx51_secure_update_aux_cr(u32 set_bits, u32 clear_bits);
+extern u32 rx51_secure_rng_call(u32 ptr, u32 count, u32 flag);
+
 #ifdef CONFIG_OMAP4_ERRATA_I688
 extern int omap_barrier_reserve_memblock(void);
 #else
index f6441c13cd8ce35ba78fb526f2a33d1123064f91..fd90125bffc70ad6719bfc2b9f3e22d21b595367 100644 (file)
@@ -1,9 +1,11 @@
 /*
- * OMAP44xx secure APIs file.
+ * OMAP34xx and OMAP44xx secure APIs file.
  *
  * Copyright (C) 2010 Texas Instruments, Inc.
  * Written by Santosh Shilimkar <santosh.shilimkar@ti.com>
  *
+ * Copyright (C) 2012 Ivaylo Dimitrov <freemangordon@abv.bg>
+ * Copyright (C) 2013 Pali Rohár <pali.rohar@gmail.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
@@ -54,6 +56,23 @@ ENTRY(omap_smc2)
        ldmfd   sp!, {r4-r12, pc}
 ENDPROC(omap_smc2)
 
+/**
+ * u32 omap_smc3(u32 service_id, u32 process_id, u32 flag, u32 pargs)
+ * Low level common routine for secure HAL and PPA APIs via smc #1
+ * r0 - @service_id: Secure Service ID
+ * r1 - @process_id: Process ID
+ * r2 - @flag: Flag to indicate the criticality of operation
+ * r3 - @pargs: Physical address of parameter list
+ */
+ENTRY(omap_smc3)
+       stmfd   sp!, {r4-r11, lr}
+       mov     r12, r0         @ Copy the secure service ID
+       mov     r6, #0xff       @ Indicate new Task call
+       dsb                     @ Memory Barrier (not sure if needed, copied from omap_smc2)
+       smc     #1              @ Call PPA service
+       ldmfd   sp!, {r4-r11, pc}
+ENDPROC(omap_smc3)
+
 ENTRY(omap_modify_auxcoreboot0)
        stmfd   sp!, {r1-r12, lr}
        ldr     r12, =0x104