OMAP3: allow to disable UART4
authorGrazvydas Ignotas <notasas@gmail.com>
Tue, 5 Jul 2016 21:34:23 +0000 (00:34 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Tue, 5 Jul 2016 21:34:23 +0000 (00:34 +0300)
and disable on pandora so that resources are not wasted to manage it

arch/arm/configs/omap3_pandora_defconfig
arch/arm/mach-omap2/Kconfig
arch/arm/mach-omap2/pm34xx.c
arch/arm/mach-omap2/serial.c

index 87ba1ab..9f11618 100644 (file)
@@ -1,6 +1,6 @@
 #
 # Automatically generated file; DO NOT EDIT.
-# Linux/arm 3.2.80 Kernel Configuration
+# Linux/arm 3.2.81 Kernel Configuration
 #
 CONFIG_ARM=y
 CONFIG_SYS_SUPPORTS_APM_EMULATION=y
@@ -345,6 +345,7 @@ CONFIG_MACH_OMAP3_PANDORA=y
 # CONFIG_MACH_OMAP_3630SDP is not set
 CONFIG_OMAP3_EMU=y
 CONFIG_OMAP3_SDRC_AC_TIMING=y
+CONFIG_OMAP3_DISABLE_UART4=y
 
 #
 # System MMU
index 527c58d..145511b 100644 (file)
@@ -352,6 +352,15 @@ config OMAP3_SDRC_AC_TIMING
          wish to say no.  Selecting yes without understanding what is
          going on could result in system crashes;
 
+config OMAP3_DISABLE_UART4
+       bool "Disable UART4"
+       depends on ARCH_OMAP3
+       default n
+       help
+         Allows to disable UART4 on OMAP36xx/DM37xx so that the kernel doesn't
+         have to manage it. On older OMAP3s UART4 is not available and this
+         option has no effect.
+
 endmenu
 
 endif
index dabc07f..abea9e9 100644 (file)
@@ -674,6 +674,9 @@ static void __init prcm_setup_regs(void)
                                        OMAP3630_EN_UART4_MASK : 0;
        u32 omap3630_grpsel_uart4_mask = cpu_is_omap3630() ?
                                        OMAP3630_GRPSEL_UART4_MASK : 0;
+#ifdef CONFIG_OMAP3_DISABLE_UART4
+       omap3630_en_uart4_mask = omap3630_grpsel_uart4_mask = 0;
+#endif
 
        /* XXX This should be handled by hwmod code or SCM init code */
        omap_ctrl_writel(OMAP3430_AUTOIDLE_MASK, OMAP2_CONTROL_SYSCONFIG);
index 3b6756e..9ccb723 100644 (file)
@@ -679,6 +679,13 @@ static int __init omap_serial_early_init(void)
                struct omap_hwmod *oh;
                struct omap_uart_state *uart;
 
+#ifdef CONFIG_OMAP3_DISABLE_UART4
+               if (i == 3) {
+                       i++;
+                       continue;
+               }
+#endif
+
                snprintf(oh_name, MAX_UART_HWMOD_NAME_LEN,
                         "uart%d", i + 1);
                oh = omap_hwmod_lookup(oh_name);