Commit 0de79d7b83726b17ac73d29c8ac08d9fb9e89d7e

Authored by Eric Lee
1 parent f9221df73b

ARM: OMAP2+: Add command line parameter for debugSS module control

Showing 4 changed files with 87 additions and 4 deletions Side-by-side Diff

Documentation/kernel-parameters.txt
... ... @@ -2283,6 +2283,9 @@
2283 2283 For example, to override I2C bus2:
2284 2284 omap_mux=i2c2_scl.i2c2_scl=0x100,i2c2_sda.i2c2_sda=0x100
2285 2285  
  2286 + omap_debugss_en [OMAP] Enable Debug Sub-System module required
  2287 + for JTAG debugging.
  2288 +
2286 2289 oprofile.timer= [HW]
2287 2290 Use timer interrupt instead of performance counters
2288 2291  
arch/arm/configs/smarc_t335x_defconfig
... ... @@ -2596,13 +2596,13 @@
2596 2596 #
2597 2597 # OMAP Display Device Drivers (new device model)
2598 2598 #
2599   -CONFIG_DISPLAY_ENCODER_TFP410=y
  2599 +# CONFIG_DISPLAY_ENCODER_TFP410 is not set
2600 2600 # CONFIG_DISPLAY_ENCODER_TPD12S015 is not set
2601 2601 # CONFIG_DISPLAY_DRA7EVM_ENCODER_TPD12S015 is not set
2602 2602 # CONFIG_DISPLAY_ENCODER_SII9022 is not set
2603   -CONFIG_DISPLAY_CONNECTOR_DVI=y
  2603 +CONFIG_DISPLAY_CONNECTOR_DVI=m
2604 2604 # CONFIG_DISPLAY_CONNECTOR_HDMI is not set
2605   -CONFIG_DISPLAY_CONNECTOR_ANALOG_TV=y
  2605 +CONFIG_DISPLAY_CONNECTOR_ANALOG_TV=m
2606 2606 CONFIG_DISPLAY_PANEL_DPI=y
2607 2607 # CONFIG_DISPLAY_PANEL_DSI_CM is not set
2608 2608 # CONFIG_DISPLAY_PANEL_SONY_ACX565AKM is not set
arch/arm/mach-omap2/Makefile
... ... @@ -8,7 +8,7 @@
8 8 # Common support
9 9 obj-y := id.o io.o control.o mux.o devices.o fb.o serial.o gpmc.o timer.o pm.o \
10 10 common.o gpio.o dma.o wd_timer.o display.o i2c.o hdq1w.o omap_hwmod.o \
11   - omap_device.o sram.o drm.o
  11 + omap_device.o sram.o drm.o debugss.o
12 12  
13 13 omap-2-3-common = irq.o
14 14 hwmod-common = omap_hwmod.o omap_hwmod_reset.o \
arch/arm/mach-omap2/debugss.c
  1 +/*
  2 + * debugss.c: Debug Sus-System related code goes in here
  3 + *
  4 + * Copyright (C) {2013} Texas Instruments Incorporated - http://www.ti.com/
  5 + *
  6 + * This file is automatically generated from the AM33XX hardware databases.
  7 + * This program is free software; you can redistribute it and/or
  8 + * modify it under the terms of the GNU General Public License as
  9 + * published by the Free Software Foundation version 2.
  10 + *
  11 + * This program is distributed "as is" WITHOUT ANY WARRANTY of any
  12 + * kind, whether express or implied; without even the implied warranty
  13 + * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14 + * GNU General Public License for more details.
  15 + */
  16 +
  17 +#include <linux/init.h>
  18 +#include <linux/err.h>
  19 +#include <linux/clk.h>
  20 +
  21 +#include "omap_hwmod.h"
  22 +
  23 +static bool is_debugss_en;
  24 +
  25 +/**
  26 + * omap_debugss_en - Enable debugss clock/module based on user config
  27 + *
  28 + * During kernel bootup, omap2 hwmod framework will disable all the
  29 + * unused/unclaimed modules, which in turn also disables debugss module.
  30 + * This breaks any further debugging capability provided by HW.
  31 + *
  32 + *
  33 + * Introduce early param which allows user to enable clock/module -
  34 + *
  35 + * omap_debugss_en (For all OMAP2 architectures)
  36 + *
  37 + * Please note that, with this command-line param, module always remain
  38 + * enabled.
  39 + */
  40 +static int __init omap_debugss_en(char *str)
  41 +{
  42 + is_debugss_en = true;
  43 + return 0;
  44 +}
  45 +early_param("omap_debugss_en", omap_debugss_en);
  46 +
  47 +static int __init _omap2_debugss_enable(void)
  48 +{
  49 + const char oh_name[10] = "debugss";
  50 + struct omap_hwmod *oh;
  51 + int ret;
  52 +
  53 + if (is_debugss_en) {
  54 + struct omap_hwmod_opt_clk *oc;
  55 + int i;
  56 +
  57 + oh = omap_hwmod_lookup(oh_name);
  58 + if (!oh) {
  59 + pr_err("debugss device not found\n");
  60 + return 0;
  61 + }
  62 +
  63 + /* Make sure that hwmod internal data structures are setup */
  64 + ret = omap_hwmod_setup_one(oh_name);
  65 + if (ret) {
  66 + pr_err("failed to setup hwmod for %s\n", oh_name);
  67 + return 0;
  68 + }
  69 + /* Enable optional clocks */
  70 + for (i = oh->opt_clks_cnt, oc = oh->opt_clks; i > 0; i--, oc++) {
  71 + if (oc->_clk)
  72 + clk_prepare_enable(oc->_clk);
  73 + }
  74 + /* Enable debugss clock/module */
  75 + omap_hwmod_enable(oh);
  76 + }
  77 +
  78 + return 0;
  79 +}
  80 +device_initcall(_omap2_debugss_enable);