2 * Copyright (C) 2012-2015 Panasonic Corporation
3 * Copyright (C) 2015-2016 Socionext Inc.
4 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
6 * SPDX-License-Identifier: GPL-2.0+
14 #include "micro-support-card.h"
18 DECLARE_GLOBAL_DATA_PTR;
20 #ifdef CONFIG_ARCH_UNIPHIER_LD11
21 static void uniphier_ld11_misc_init(void)
23 sg_set_pinsel(149, 14, 8, 4); /* XIRQ0 -> XIRQ0 */
25 sg_set_pinsel(153, 14, 8, 4); /* XIRQ4 -> XIRQ4 */
30 #ifdef CONFIG_ARCH_UNIPHIER_LD20
31 static void uniphier_ld20_misc_init(void)
33 sg_set_pinsel(149, 14, 8, 4); /* XIRQ0 -> XIRQ0 */
35 sg_set_pinsel(153, 14, 8, 4); /* XIRQ4 -> XIRQ4 */
38 /* ES1 errata: increase VDD09 supply to suppress VBO noise */
39 if (uniphier_get_soc_revision() == 1) {
40 writel(0x00000003, 0x6184e004);
41 writel(0x00000100, 0x6184e040);
42 writel(0x0000b500, 0x6184e024);
43 writel(0x00000001, 0x6184e000);
48 struct uniphier_initdata {
50 void (*sbc_init)(void);
51 void (*pll_init)(void);
52 void (*clk_init)(void);
53 void (*misc_init)(void);
56 static const struct uniphier_initdata uniphier_initdata[] = {
57 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
59 .soc_id = UNIPHIER_LD4_ID,
60 .sbc_init = uniphier_ld4_sbc_init,
61 .pll_init = uniphier_ld4_pll_init,
62 .clk_init = uniphier_ld4_clk_init,
65 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
67 .soc_id = UNIPHIER_PRO4_ID,
68 .sbc_init = uniphier_sbc_init_savepin,
69 .pll_init = uniphier_pro4_pll_init,
70 .clk_init = uniphier_pro4_clk_init,
73 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
75 .soc_id = UNIPHIER_SLD8_ID,
76 .sbc_init = uniphier_ld4_sbc_init,
77 .pll_init = uniphier_ld4_pll_init,
78 .clk_init = uniphier_ld4_clk_init,
81 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
83 .soc_id = UNIPHIER_PRO5_ID,
84 .sbc_init = uniphier_sbc_init_savepin,
85 .clk_init = uniphier_pro5_clk_init,
88 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
90 .soc_id = UNIPHIER_PXS2_ID,
91 .sbc_init = uniphier_pxs2_sbc_init,
92 .clk_init = uniphier_pxs2_clk_init,
95 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
97 .soc_id = UNIPHIER_LD6B_ID,
98 .sbc_init = uniphier_pxs2_sbc_init,
99 .clk_init = uniphier_pxs2_clk_init,
102 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
104 .soc_id = UNIPHIER_LD11_ID,
105 .sbc_init = uniphier_ld11_sbc_init,
106 .pll_init = uniphier_ld11_pll_init,
107 .clk_init = uniphier_ld11_clk_init,
108 .misc_init = uniphier_ld11_misc_init,
111 #if defined(CONFIG_ARCH_UNIPHIER_LD20)
113 .soc_id = UNIPHIER_LD20_ID,
114 .sbc_init = uniphier_ld11_sbc_init,
115 .pll_init = uniphier_ld20_pll_init,
116 .clk_init = uniphier_ld20_clk_init,
117 .misc_init = uniphier_ld20_misc_init,
120 #if defined(CONFIG_ARCH_UNIPHIER_PXS3)
122 .soc_id = UNIPHIER_PXS3_ID,
123 .sbc_init = uniphier_pxs2_sbc_init,
124 .pll_init = uniphier_pxs3_pll_init,
125 .clk_init = uniphier_pxs3_clk_init,
129 UNIPHIER_DEFINE_SOCDATA_FUNC(uniphier_get_initdata, uniphier_initdata)
133 const struct uniphier_initdata *initdata;
137 initdata = uniphier_get_initdata();
139 pr_err("unsupported SoC\n");
143 initdata->sbc_init();
149 if (initdata->pll_init)
150 initdata->pll_init();
154 if (initdata->clk_init)
155 initdata->clk_init();
159 if (initdata->misc_init)
160 initdata->misc_init();
164 support_card_late_init();