aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlof Johansson <olof@lixom.net>2017-01-29 20:15:36 -0500
committerOlof Johansson <olof@lixom.net>2017-01-29 20:15:36 -0500
commitf0d0b8cb6bb361bd88f10900e9716eec73e262d9 (patch)
tree4648de6fb61e7e719d37b5fd6d34e6dceb0ec249
parent37b3785b136289b36f5403b4f59b2dc47c35c485 (diff)
parent8c4bc910633d942b4422e8b264c39a48e230a261 (diff)
Merge tag 'omap-for-v4.11/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/soc
SoC changes for omaps for v4.11 merge window. This adds support for keeping the interconnect target module active for uart if earlycon is specified. And we're adding Aaro Koskinen as a co-maintainer for omap1 to make sure things stay working for omap1. The other changes are mostly clean-up of old legacy code: - Remove unused omap_display_init() - Make omapdss_find_dss_of_node() function static - Add support for earlycon - Tidy up omap1 usb logging output with pr_cont - Make omap_otg_init() static - Delete redundant CPU class checks for omap1 - Remove unused mpurate cmdline option that has not done anything for past 1.5 years at least * tag 'omap-for-v4.11/soc-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP: clock: Remove unused mpurate cmdline option ARM: OMAP2+: omap_hwmod: Add support for earlycon MAINTAINERS: Add Aaro Koskinen as TI omap1 SoC co-maintainer ARM: OMAP1: USB: delete redundant CPU class checks ARM: OMAP1: USB: make omap_otg_init() static ARM: OMAP1: USB: tidy up logging output ARM: OMAP2+: Make the omapdss_find_dss_of_node() function static ARM: OMAP2+: Remove unused omap_display_init() function Signed-off-by: Olof Johansson <olof@lixom.net>
-rw-r--r--MAINTAINERS19
-rw-r--r--arch/arm/mach-omap1/clock.c20
-rw-r--r--arch/arm/mach-omap1/clock.h2
-rw-r--r--arch/arm/mach-omap1/include/mach/usb.h2
-rw-r--r--arch/arm/mach-omap1/usb.c51
-rw-r--r--arch/arm/mach-omap2/clock.c61
-rw-r--r--arch/arm/mach-omap2/clock.h4
-rw-r--r--arch/arm/mach-omap2/display.c258
-rw-r--r--arch/arm/mach-omap2/display.h7
-rw-r--r--arch/arm/mach-omap2/omap_hwmod.c33
10 files changed, 74 insertions, 383 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 5f0420a0da5b..5e92f5500729 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8919,7 +8919,20 @@ M: Josh Poimboeuf <jpoimboe@redhat.com>
8919S: Supported 8919S: Supported
8920F: tools/objtool/ 8920F: tools/objtool/
8921 8921
8922OMAP SUPPORT 8922OMAP1 SUPPORT
8923M: Aaro Koskinen <aaro.koskinen@iki.fi>
8924M: Tony Lindgren <tony@atomide.com>
8925L: linux-omap@vger.kernel.org
8926Q: http://patchwork.kernel.org/project/linux-omap/list/
8927T: git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
8928S: Maintained
8929F: arch/arm/mach-omap1/
8930F: arch/arm/plat-omap/
8931F: arch/arm/configs/omap1_defconfig
8932F: drivers/i2c/busses/i2c-omap.c
8933F: include/linux/i2c-omap.h
8934
8935OMAP2+ SUPPORT
8923M: Tony Lindgren <tony@atomide.com> 8936M: Tony Lindgren <tony@atomide.com>
8924L: linux-omap@vger.kernel.org 8937L: linux-omap@vger.kernel.org
8925W: http://www.muru.com/linux/omap/ 8938W: http://www.muru.com/linux/omap/
@@ -8927,8 +8940,8 @@ W: http://linux.omap.com/
8927Q: http://patchwork.kernel.org/project/linux-omap/list/ 8940Q: http://patchwork.kernel.org/project/linux-omap/list/
8928T: git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git 8941T: git git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap.git
8929S: Maintained 8942S: Maintained
8930F: arch/arm/*omap*/ 8943F: arch/arm/mach-omap2/
8931F: arch/arm/configs/omap1_defconfig 8944F: arch/arm/plat-omap/
8932F: arch/arm/configs/omap2plus_defconfig 8945F: arch/arm/configs/omap2plus_defconfig
8933F: drivers/i2c/busses/i2c-omap.c 8946F: drivers/i2c/busses/i2c-omap.c
8934F: drivers/irqchip/irq-omap-intc.c 8947F: drivers/irqchip/irq-omap-intc.c
diff --git a/arch/arm/mach-omap1/clock.c b/arch/arm/mach-omap1/clock.c
index 4f5fd4a084c0..43e3e188f521 100644
--- a/arch/arm/mach-omap1/clock.c
+++ b/arch/arm/mach-omap1/clock.c
@@ -720,26 +720,6 @@ EXPORT_SYMBOL(clk_get_parent);
720 * OMAP specific clock functions shared between omap1 and omap2 720 * OMAP specific clock functions shared between omap1 and omap2
721 */ 721 */
722 722
723int __initdata mpurate;
724
725/*
726 * By default we use the rate set by the bootloader.
727 * You can override this with mpurate= cmdline option.
728 */
729static int __init omap_clk_setup(char *str)
730{
731 get_option(&str, &mpurate);
732
733 if (!mpurate)
734 return 1;
735
736 if (mpurate < 1000)
737 mpurate *= 1000000;
738
739 return 1;
740}
741__setup("mpurate=", omap_clk_setup);
742
743/* Used for clocks that always have same value as the parent clock */ 723/* Used for clocks that always have same value as the parent clock */
744unsigned long followparent_recalc(struct clk *clk) 724unsigned long followparent_recalc(struct clk *clk)
745{ 725{
diff --git a/arch/arm/mach-omap1/clock.h b/arch/arm/mach-omap1/clock.h
index 1e4918a3a5ee..f2d1be211723 100644
--- a/arch/arm/mach-omap1/clock.h
+++ b/arch/arm/mach-omap1/clock.h
@@ -173,8 +173,6 @@ struct clk_functions {
173 void (*clk_disable_unused)(struct clk *clk); 173 void (*clk_disable_unused)(struct clk *clk);
174}; 174};
175 175
176extern int mpurate;
177
178extern int clk_init(struct clk_functions *custom_clocks); 176extern int clk_init(struct clk_functions *custom_clocks);
179extern void clk_preinit(struct clk *clk); 177extern void clk_preinit(struct clk *clk);
180extern int clk_register(struct clk *clk); 178extern int clk_register(struct clk *clk);
diff --git a/arch/arm/mach-omap1/include/mach/usb.h b/arch/arm/mach-omap1/include/mach/usb.h
index a7c5559caef2..eb76628ff843 100644
--- a/arch/arm/mach-omap1/include/mach/usb.h
+++ b/arch/arm/mach-omap1/include/mach/usb.h
@@ -10,8 +10,6 @@
10 10
11#include <linux/platform_data/usb-omap1.h> 11#include <linux/platform_data/usb-omap1.h>
12 12
13void omap_otg_init(struct omap_usb_config *config);
14
15#if IS_ENABLED(CONFIG_USB) 13#if IS_ENABLED(CONFIG_USB)
16void omap1_usb_init(struct omap_usb_config *pdata); 14void omap1_usb_init(struct omap_usb_config *pdata);
17#else 15#else
diff --git a/arch/arm/mach-omap1/usb.c b/arch/arm/mach-omap1/usb.c
index 2506e598a067..455e2cf2866d 100644
--- a/arch/arm/mach-omap1/usb.c
+++ b/arch/arm/mach-omap1/usb.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Platform level USB initialization for FS USB OTG controller on omap1 and 24xx 2 * Platform level USB initialization for FS USB OTG controller on omap1
3 * 3 *
4 * Copyright (C) 2004 Texas Instruments, Inc. 4 * Copyright (C) 2004 Texas Instruments, Inc.
5 * 5 *
@@ -58,11 +58,12 @@
58 58
59#ifdef CONFIG_ARCH_OMAP_OTG 59#ifdef CONFIG_ARCH_OMAP_OTG
60 60
61void __init 61static void __init
62omap_otg_init(struct omap_usb_config *config) 62omap_otg_init(struct omap_usb_config *config)
63{ 63{
64 u32 syscon; 64 u32 syscon;
65 int alt_pingroup = 0; 65 int alt_pingroup = 0;
66 u16 w;
66 67
67 /* NOTE: no bus or clock setup (yet?) */ 68 /* NOTE: no bus or clock setup (yet?) */
68 69
@@ -87,39 +88,35 @@ omap_otg_init(struct omap_usb_config *config)
87 if (config->otg) 88 if (config->otg)
88 syscon |= OTG_EN; 89 syscon |= OTG_EN;
89#endif 90#endif
90 if (cpu_class_is_omap1()) 91 pr_debug("USB_TRANSCEIVER_CTRL = %03x\n",
91 pr_debug("USB_TRANSCEIVER_CTRL = %03x\n", 92 omap_readl(USB_TRANSCEIVER_CTRL));
92 omap_readl(USB_TRANSCEIVER_CTRL));
93 pr_debug("OTG_SYSCON_2 = %08x\n", omap_readl(OTG_SYSCON_2)); 93 pr_debug("OTG_SYSCON_2 = %08x\n", omap_readl(OTG_SYSCON_2));
94 omap_writel(syscon, OTG_SYSCON_2); 94 omap_writel(syscon, OTG_SYSCON_2);
95 95
96 printk("USB: hmc %d", config->hmc_mode); 96 printk("USB: hmc %d", config->hmc_mode);
97 if (!alt_pingroup) 97 if (!alt_pingroup)
98 printk(", usb2 alt %d wires", config->pins[2]); 98 pr_cont(", usb2 alt %d wires", config->pins[2]);
99 else if (config->pins[0]) 99 else if (config->pins[0])
100 printk(", usb0 %d wires%s", config->pins[0], 100 pr_cont(", usb0 %d wires%s", config->pins[0],
101 is_usb0_device(config) ? " (dev)" : ""); 101 is_usb0_device(config) ? " (dev)" : "");
102 if (config->pins[1]) 102 if (config->pins[1])
103 printk(", usb1 %d wires", config->pins[1]); 103 pr_cont(", usb1 %d wires", config->pins[1]);
104 if (!alt_pingroup && config->pins[2]) 104 if (!alt_pingroup && config->pins[2])
105 printk(", usb2 %d wires", config->pins[2]); 105 pr_cont(", usb2 %d wires", config->pins[2]);
106 if (config->otg) 106 if (config->otg)
107 printk(", Mini-AB on usb%d", config->otg - 1); 107 pr_cont(", Mini-AB on usb%d", config->otg - 1);
108 printk("\n"); 108 pr_cont("\n");
109 109
110 if (cpu_class_is_omap1()) { 110 /* leave USB clocks/controllers off until needed */
111 u16 w; 111 w = omap_readw(ULPD_SOFT_REQ);
112 w &= ~SOFT_USB_CLK_REQ;
113 omap_writew(w, ULPD_SOFT_REQ);
112 114
113 /* leave USB clocks/controllers off until needed */ 115 w = omap_readw(ULPD_CLOCK_CTRL);
114 w = omap_readw(ULPD_SOFT_REQ); 116 w &= ~USB_MCLK_EN;
115 w &= ~SOFT_USB_CLK_REQ; 117 w |= DIS_USB_PVCI_CLK;
116 omap_writew(w, ULPD_SOFT_REQ); 118 omap_writew(w, ULPD_CLOCK_CTRL);
117 119
118 w = omap_readw(ULPD_CLOCK_CTRL);
119 w &= ~USB_MCLK_EN;
120 w |= DIS_USB_PVCI_CLK;
121 omap_writew(w, ULPD_CLOCK_CTRL);
122 }
123 syscon = omap_readl(OTG_SYSCON_1); 120 syscon = omap_readl(OTG_SYSCON_1);
124 syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN; 121 syscon |= HST_IDLE_EN|DEV_IDLE_EN|OTG_IDLE_EN;
125 122
@@ -166,7 +163,7 @@ omap_otg_init(struct omap_usb_config *config)
166} 163}
167 164
168#else 165#else
169void omap_otg_init(struct omap_usb_config *config) {} 166static void omap_otg_init(struct omap_usb_config *config) {}
170#endif 167#endif
171 168
172#if IS_ENABLED(CONFIG_USB_OMAP) 169#if IS_ENABLED(CONFIG_USB_OMAP)
@@ -573,13 +570,13 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config)
573 570
574 printk("USB: hmc %d", config->hmc_mode); 571 printk("USB: hmc %d", config->hmc_mode);
575 if (config->pins[0]) 572 if (config->pins[0])
576 printk(", usb0 %d wires%s", config->pins[0], 573 pr_cont(", usb0 %d wires%s", config->pins[0],
577 is_usb0_device(config) ? " (dev)" : ""); 574 is_usb0_device(config) ? " (dev)" : "");
578 if (config->pins[1]) 575 if (config->pins[1])
579 printk(", usb1 %d wires", config->pins[1]); 576 pr_cont(", usb1 %d wires", config->pins[1]);
580 if (config->pins[2]) 577 if (config->pins[2])
581 printk(", usb2 %d wires", config->pins[2]); 578 pr_cont(", usb2 %d wires", config->pins[2]);
582 printk("\n"); 579 pr_cont("\n");
583 580
584 /* use DPLL for 48 MHz function clock */ 581 /* use DPLL for 48 MHz function clock */
585 pr_debug("APLL %04x DPLL %04x REQ %04x\n", omap_readw(ULPD_APLL_CTRL), 582 pr_debug("APLL %04x DPLL %04x REQ %04x\n", omap_readw(ULPD_APLL_CTRL),
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c
index d058125876d8..1270afdcacdf 100644
--- a/arch/arm/mach-omap2/clock.c
+++ b/arch/arm/mach-omap2/clock.c
@@ -78,8 +78,6 @@ int __init omap2_clk_setup_ll_ops(void)
78 * OMAP2+ specific clock functions 78 * OMAP2+ specific clock functions
79 */ 79 */
80 80
81/* Private functions */
82
83/* Public functions */ 81/* Public functions */
84 82
85/** 83/**
@@ -112,65 +110,6 @@ void omap2_init_clk_clkdm(struct clk_hw *hw)
112 } 110 }
113} 111}
114 112
115static int __initdata mpurate;
116
117/*
118 * By default we use the rate set by the bootloader.
119 * You can override this with mpurate= cmdline option.
120 */
121static int __init omap_clk_setup(char *str)
122{
123 get_option(&str, &mpurate);
124
125 if (!mpurate)
126 return 1;
127
128 if (mpurate < 1000)
129 mpurate *= 1000000;
130
131 return 1;
132}
133__setup("mpurate=", omap_clk_setup);
134
135/**
136 * omap2_clk_print_new_rates - print summary of current clock tree rates
137 * @hfclkin_ck_name: clk name for the off-chip HF oscillator
138 * @core_ck_name: clk name for the on-chip CORE_CLK
139 * @mpu_ck_name: clk name for the ARM MPU clock
140 *
141 * Prints a short message to the console with the HFCLKIN oscillator
142 * rate, the rate of the CORE clock, and the rate of the ARM MPU clock.
143 * Called by the boot-time MPU rate switching code. XXX This is intended
144 * to be handled by the OPP layer code in the near future and should be
145 * removed from the clock code. No return value.
146 */
147void __init omap2_clk_print_new_rates(const char *hfclkin_ck_name,
148 const char *core_ck_name,
149 const char *mpu_ck_name)
150{
151 struct clk *hfclkin_ck, *core_ck, *mpu_ck;
152 unsigned long hfclkin_rate;
153
154 mpu_ck = clk_get(NULL, mpu_ck_name);
155 if (WARN(IS_ERR(mpu_ck), "clock: failed to get %s.\n", mpu_ck_name))
156 return;
157
158 core_ck = clk_get(NULL, core_ck_name);
159 if (WARN(IS_ERR(core_ck), "clock: failed to get %s.\n", core_ck_name))
160 return;
161
162 hfclkin_ck = clk_get(NULL, hfclkin_ck_name);
163 if (WARN(IS_ERR(hfclkin_ck), "Failed to get %s.\n", hfclkin_ck_name))
164 return;
165
166 hfclkin_rate = clk_get_rate(hfclkin_ck);
167
168 pr_info("Switched to new clocking rate (Crystal/Core/MPU): %ld.%01ld/%ld/%ld MHz\n",
169 (hfclkin_rate / 1000000), ((hfclkin_rate / 100000) % 10),
170 (clk_get_rate(core_ck) / 1000000),
171 (clk_get_rate(mpu_ck) / 1000000));
172}
173
174/** 113/**
175 * ti_clk_init_features - init clock features struct for the SoC 114 * ti_clk_init_features - init clock features struct for the SoC
176 * 115 *
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h
index 67da640ba1c7..4e66295dca25 100644
--- a/arch/arm/mach-omap2/clock.h
+++ b/arch/arm/mach-omap2/clock.h
@@ -64,10 +64,6 @@
64#define OMAP4XXX_EN_DPLL_FRBYPASS 0x6 64#define OMAP4XXX_EN_DPLL_FRBYPASS 0x6
65#define OMAP4XXX_EN_DPLL_LOCKED 0x7 65#define OMAP4XXX_EN_DPLL_LOCKED 0x7
66 66
67void omap2_clk_print_new_rates(const char *hfclkin_ck_name,
68 const char *core_ck_name,
69 const char *mpu_ck_name);
70
71extern u16 cpu_mask; 67extern u16 cpu_mask;
72 68
73extern const struct clkops clkops_omap2_dflt_wait; 69extern const struct clkops clkops_omap2_dflt_wait;
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index e71cca0950e9..8fa01c0ecdb2 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -46,8 +46,6 @@
46#define DISPC_CONTROL3 0x0848 46#define DISPC_CONTROL3 0x0848
47#define DISPC_IRQSTATUS 0x0018 47#define DISPC_IRQSTATUS 0x0018
48 48
49#define DSS_SYSCONFIG 0x10
50#define DSS_SYSSTATUS 0x14
51#define DSS_CONTROL 0x40 49#define DSS_CONTROL 0x40
52#define DSS_SDI_CONTROL 0x44 50#define DSS_SDI_CONTROL 0x44
53#define DSS_PLL_CONTROL 0x48 51#define DSS_PLL_CONTROL 0x48
@@ -76,36 +74,6 @@ static struct platform_device omap_display_device = {
76 }, 74 },
77}; 75};
78 76
79struct omap_dss_hwmod_data {
80 const char *oh_name;
81 const char *dev_name;
82 const int id;
83};
84
85static const struct omap_dss_hwmod_data omap2_dss_hwmod_data[] __initconst = {
86 { "dss_core", "omapdss_dss", -1 },
87 { "dss_dispc", "omapdss_dispc", -1 },
88 { "dss_rfbi", "omapdss_rfbi", -1 },
89 { "dss_venc", "omapdss_venc", -1 },
90};
91
92static const struct omap_dss_hwmod_data omap3_dss_hwmod_data[] __initconst = {
93 { "dss_core", "omapdss_dss", -1 },
94 { "dss_dispc", "omapdss_dispc", -1 },
95 { "dss_rfbi", "omapdss_rfbi", -1 },
96 { "dss_venc", "omapdss_venc", -1 },
97 { "dss_dsi1", "omapdss_dsi", 0 },
98};
99
100static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initconst = {
101 { "dss_core", "omapdss_dss", -1 },
102 { "dss_dispc", "omapdss_dispc", -1 },
103 { "dss_rfbi", "omapdss_rfbi", -1 },
104 { "dss_dsi1", "omapdss_dsi", 0 },
105 { "dss_dsi2", "omapdss_dsi", 1 },
106 { "dss_hdmi", "omapdss_hdmi", -1 },
107};
108
109#define OMAP4_DSIPHY_SYSCON_OFFSET 0x78 77#define OMAP4_DSIPHY_SYSCON_OFFSET 0x78
110 78
111static struct regmap *omap4_dsi_mux_syscon; 79static struct regmap *omap4_dsi_mux_syscon;
@@ -162,104 +130,6 @@ static int omap_dss_set_min_bus_tput(struct device *dev, unsigned long tput)
162 return omap_pm_set_min_bus_tput(dev, OCP_INITIATOR_AGENT, tput); 130 return omap_pm_set_min_bus_tput(dev, OCP_INITIATOR_AGENT, tput);
163} 131}
164 132
165static struct platform_device *create_dss_pdev(const char *pdev_name,
166 int pdev_id, const char *oh_name, void *pdata, int pdata_len,
167 struct platform_device *parent)
168{
169 struct platform_device *pdev;
170 struct omap_device *od;
171 struct omap_hwmod *ohs[1];
172 struct omap_hwmod *oh;
173 int r;
174
175 oh = omap_hwmod_lookup(oh_name);
176 if (!oh) {
177 pr_err("Could not look up %s\n", oh_name);
178 r = -ENODEV;
179 goto err;
180 }
181
182 pdev = platform_device_alloc(pdev_name, pdev_id);
183 if (!pdev) {
184 pr_err("Could not create pdev for %s\n", pdev_name);
185 r = -ENOMEM;
186 goto err;
187 }
188
189 if (parent != NULL)
190 pdev->dev.parent = &parent->dev;
191
192 if (pdev->id != -1)
193 dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id);
194 else
195 dev_set_name(&pdev->dev, "%s", pdev->name);
196
197 ohs[0] = oh;
198 od = omap_device_alloc(pdev, ohs, 1);
199 if (IS_ERR(od)) {
200 pr_err("Could not alloc omap_device for %s\n", pdev_name);
201 r = -ENOMEM;
202 goto err;
203 }
204
205 r = platform_device_add_data(pdev, pdata, pdata_len);
206 if (r) {
207 pr_err("Could not set pdata for %s\n", pdev_name);
208 goto err;
209 }
210
211 r = omap_device_register(pdev);
212 if (r) {
213 pr_err("Could not register omap_device for %s\n", pdev_name);
214 goto err;
215 }
216
217 return pdev;
218
219err:
220 return ERR_PTR(r);
221}
222
223static struct platform_device *create_simple_dss_pdev(const char *pdev_name,
224 int pdev_id, void *pdata, int pdata_len,
225 struct platform_device *parent)
226{
227 struct platform_device *pdev;
228 int r;
229
230 pdev = platform_device_alloc(pdev_name, pdev_id);
231 if (!pdev) {
232 pr_err("Could not create pdev for %s\n", pdev_name);
233 r = -ENOMEM;
234 goto err;
235 }
236
237 if (parent != NULL)
238 pdev->dev.parent = &parent->dev;
239
240 if (pdev->id != -1)
241 dev_set_name(&pdev->dev, "%s.%d", pdev->name, pdev->id);
242 else
243 dev_set_name(&pdev->dev, "%s", pdev->name);
244
245 r = platform_device_add_data(pdev, pdata, pdata_len);
246 if (r) {
247 pr_err("Could not set pdata for %s\n", pdev_name);
248 goto err;
249 }
250
251 r = platform_device_add(pdev);
252 if (r) {
253 pr_err("Could not register platform_device for %s\n", pdev_name);
254 goto err;
255 }
256
257 return pdev;
258
259err:
260 return ERR_PTR(r);
261}
262
263static enum omapdss_version __init omap_display_get_version(void) 133static enum omapdss_version __init omap_display_get_version(void)
264{ 134{
265 if (cpu_is_omap24xx()) 135 if (cpu_is_omap24xx())
@@ -293,132 +163,6 @@ static enum omapdss_version __init omap_display_get_version(void)
293 return OMAPDSS_VER_UNKNOWN; 163 return OMAPDSS_VER_UNKNOWN;
294} 164}
295 165
296int __init omap_display_init(struct omap_dss_board_info *board_data)
297{
298 int r = 0;
299 struct platform_device *pdev;
300 int i, oh_count;
301 const struct omap_dss_hwmod_data *curr_dss_hwmod;
302 struct platform_device *dss_pdev;
303 enum omapdss_version ver;
304
305 /* create omapdss device */
306
307 ver = omap_display_get_version();
308
309 if (ver == OMAPDSS_VER_UNKNOWN) {
310 pr_err("DSS not supported on this SoC\n");
311 return -ENODEV;
312 }
313
314 board_data->version = ver;
315 board_data->dsi_enable_pads = omap_dsi_enable_pads;
316 board_data->dsi_disable_pads = omap_dsi_disable_pads;
317 board_data->set_min_bus_tput = omap_dss_set_min_bus_tput;
318
319 omap_display_device.dev.platform_data = board_data;
320
321 r = platform_device_register(&omap_display_device);
322 if (r < 0) {
323 pr_err("Unable to register omapdss device\n");
324 return r;
325 }
326
327 /* create devices for dss hwmods */
328
329 if (cpu_is_omap24xx()) {
330 curr_dss_hwmod = omap2_dss_hwmod_data;
331 oh_count = ARRAY_SIZE(omap2_dss_hwmod_data);
332 } else if (cpu_is_omap34xx()) {
333 curr_dss_hwmod = omap3_dss_hwmod_data;
334 oh_count = ARRAY_SIZE(omap3_dss_hwmod_data);
335 } else {
336 curr_dss_hwmod = omap4_dss_hwmod_data;
337 oh_count = ARRAY_SIZE(omap4_dss_hwmod_data);
338 }
339
340 /*
341 * First create the pdev for dss_core, which is used as a parent device
342 * by the other dss pdevs. Note: dss_core has to be the first item in
343 * the hwmod list.
344 */
345 dss_pdev = create_dss_pdev(curr_dss_hwmod[0].dev_name,
346 curr_dss_hwmod[0].id,
347 curr_dss_hwmod[0].oh_name,
348 board_data, sizeof(*board_data),
349 NULL);
350
351 if (IS_ERR(dss_pdev)) {
352 pr_err("Could not build omap_device for %s\n",
353 curr_dss_hwmod[0].oh_name);
354
355 return PTR_ERR(dss_pdev);
356 }
357
358 for (i = 1; i < oh_count; i++) {
359 pdev = create_dss_pdev(curr_dss_hwmod[i].dev_name,
360 curr_dss_hwmod[i].id,
361 curr_dss_hwmod[i].oh_name,
362 board_data, sizeof(*board_data),
363 dss_pdev);
364
365 if (IS_ERR(pdev)) {
366 pr_err("Could not build omap_device for %s\n",
367 curr_dss_hwmod[i].oh_name);
368
369 return PTR_ERR(pdev);
370 }
371 }
372
373 /* Create devices for DPI and SDI */
374
375 pdev = create_simple_dss_pdev("omapdss_dpi", 0,
376 board_data, sizeof(*board_data), dss_pdev);
377 if (IS_ERR(pdev)) {
378 pr_err("Could not build platform_device for omapdss_dpi\n");
379 return PTR_ERR(pdev);
380 }
381
382 if (cpu_is_omap34xx()) {
383 pdev = create_simple_dss_pdev("omapdss_sdi", 0,
384 board_data, sizeof(*board_data), dss_pdev);
385 if (IS_ERR(pdev)) {
386 pr_err("Could not build platform_device for omapdss_sdi\n");
387 return PTR_ERR(pdev);
388 }
389 }
390
391 /* create DRM device */
392 r = omap_init_drm();
393 if (r < 0) {
394 pr_err("Unable to register omapdrm device\n");
395 return r;
396 }
397
398 /* create vrfb device */
399 r = omap_init_vrfb();
400 if (r < 0) {
401 pr_err("Unable to register omapvrfb device\n");
402 return r;
403 }
404
405 /* create FB device */
406 r = omap_init_fb();
407 if (r < 0) {
408 pr_err("Unable to register omapfb device\n");
409 return r;
410 }
411
412 /* create V4L2 display device */
413 r = omap_init_vout();
414 if (r < 0) {
415 pr_err("Unable to register omap_vout device\n");
416 return r;
417 }
418
419 return 0;
420}
421
422static void dispc_disable_outputs(void) 166static void dispc_disable_outputs(void)
423{ 167{
424 u32 v, irq_mask = 0; 168 u32 v, irq_mask = 0;
@@ -573,7 +317,7 @@ static const char * const omapdss_compat_names[] __initconst = {
573 "ti,dra7-dss", 317 "ti,dra7-dss",
574}; 318};
575 319
576struct device_node * __init omapdss_find_dss_of_node(void) 320static struct device_node * __init omapdss_find_dss_of_node(void)
577{ 321{
578 struct device_node *node; 322 struct device_node *node;
579 int i; 323 int i;
diff --git a/arch/arm/mach-omap2/display.h b/arch/arm/mach-omap2/display.h
index 78f253005279..9a39646d4316 100644
--- a/arch/arm/mach-omap2/display.h
+++ b/arch/arm/mach-omap2/display.h
@@ -31,11 +31,4 @@ int omap_init_vrfb(void);
31int omap_init_fb(void); 31int omap_init_fb(void);
32int omap_init_vout(void); 32int omap_init_vout(void);
33 33
34struct device_node * __init omapdss_find_dss_of_node(void);
35
36struct omap_dss_board_info;
37
38/* Init with the board info */
39int omap_display_init(struct omap_dss_board_info *board_data);
40
41#endif 34#endif
diff --git a/arch/arm/mach-omap2/omap_hwmod.c b/arch/arm/mach-omap2/omap_hwmod.c
index e8b988714a09..0da4f2ea76c4 100644
--- a/arch/arm/mach-omap2/omap_hwmod.c
+++ b/arch/arm/mach-omap2/omap_hwmod.c
@@ -3249,6 +3249,36 @@ int __init omap_hwmod_setup_one(const char *oh_name)
3249} 3249}
3250 3250
3251/** 3251/**
3252 * omap_hwmod_setup_earlycon_flags - set up flags for early console
3253 *
3254 * Enable DEBUG_OMAPUART_FLAGS for uart hwmod that is being used as
3255 * early concole so that hwmod core doesn't reset and keep it in idle
3256 * that specific uart.
3257 */
3258#ifdef CONFIG_SERIAL_EARLYCON
3259static void __init omap_hwmod_setup_earlycon_flags(void)
3260{
3261 struct device_node *np;
3262 struct omap_hwmod *oh;
3263 const char *uart;
3264
3265 np = of_find_node_by_path("/chosen");
3266 if (np) {
3267 uart = of_get_property(np, "stdout-path", NULL);
3268 if (uart) {
3269 np = of_find_node_by_path(uart);
3270 if (np) {
3271 uart = of_get_property(np, "ti,hwmods", NULL);
3272 oh = omap_hwmod_lookup(uart);
3273 if (oh)
3274 oh->flags |= DEBUG_OMAPUART_FLAGS;
3275 }
3276 }
3277 }
3278}
3279#endif
3280
3281/**
3252 * omap_hwmod_setup_all - set up all registered IP blocks 3282 * omap_hwmod_setup_all - set up all registered IP blocks
3253 * 3283 *
3254 * Initialize and set up all IP blocks registered with the hwmod code. 3284 * Initialize and set up all IP blocks registered with the hwmod code.
@@ -3261,6 +3291,9 @@ static int __init omap_hwmod_setup_all(void)
3261 _ensure_mpu_hwmod_is_setup(NULL); 3291 _ensure_mpu_hwmod_is_setup(NULL);
3262 3292
3263 omap_hwmod_for_each(_init, NULL); 3293 omap_hwmod_for_each(_init, NULL);
3294#ifdef CONFIG_SERIAL_EARLYCON
3295 omap_hwmod_setup_earlycon_flags();
3296#endif
3264 omap_hwmod_for_each(_setup, NULL); 3297 omap_hwmod_for_each(_setup, NULL);
3265 3298
3266 return 0; 3299 return 0;