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_LD20
21 static void uniphier_ld20_misc_init(void)
23 /* ES1 errata: increase VDD09 supply to suppress VBO noise */
24 if (uniphier_get_soc_revision() == 1) {
25 writel(0x00000003, 0x6184e004);
26 writel(0x00000100, 0x6184e040);
27 writel(0x0000b500, 0x6184e024);
28 writel(0x00000001, 0x6184e000);
33 struct uniphier_initdata {
35 void (*sbc_init)(void);
36 void (*pll_init)(void);
37 void (*clk_init)(void);
38 void (*misc_init)(void);
41 static const struct uniphier_initdata uniphier_initdata[] = {
42 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
44 .soc_id = UNIPHIER_LD4_ID,
45 .sbc_init = uniphier_ld4_sbc_init,
46 .pll_init = uniphier_ld4_pll_init,
47 .clk_init = uniphier_ld4_clk_init,
50 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
52 .soc_id = UNIPHIER_PRO4_ID,
53 .sbc_init = uniphier_sbc_init_savepin,
54 .pll_init = uniphier_pro4_pll_init,
55 .clk_init = uniphier_pro4_clk_init,
58 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
60 .soc_id = UNIPHIER_SLD8_ID,
61 .sbc_init = uniphier_ld4_sbc_init,
62 .pll_init = uniphier_ld4_pll_init,
63 .clk_init = uniphier_ld4_clk_init,
66 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
68 .soc_id = UNIPHIER_PRO5_ID,
69 .sbc_init = uniphier_sbc_init_savepin,
70 .clk_init = uniphier_pro5_clk_init,
73 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
75 .soc_id = UNIPHIER_PXS2_ID,
76 .sbc_init = uniphier_pxs2_sbc_init,
77 .clk_init = uniphier_pxs2_clk_init,
80 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
82 .soc_id = UNIPHIER_LD6B_ID,
83 .sbc_init = uniphier_pxs2_sbc_init,
84 .clk_init = uniphier_pxs2_clk_init,
87 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
89 .soc_id = UNIPHIER_LD11_ID,
90 .sbc_init = uniphier_ld11_sbc_init,
91 .pll_init = uniphier_ld11_pll_init,
92 .clk_init = uniphier_ld11_clk_init,
95 #if defined(CONFIG_ARCH_UNIPHIER_LD20)
97 .soc_id = UNIPHIER_LD20_ID,
98 .sbc_init = uniphier_ld11_sbc_init,
99 .pll_init = uniphier_ld20_pll_init,
100 .clk_init = uniphier_ld20_clk_init,
101 .misc_init = uniphier_ld20_misc_init,
104 #if defined(CONFIG_ARCH_UNIPHIER_PXS3)
106 .soc_id = UNIPHIER_PXS3_ID,
107 .sbc_init = uniphier_pxs2_sbc_init,
108 .pll_init = uniphier_pxs3_pll_init,
109 .clk_init = uniphier_pxs3_clk_init,
113 UNIPHIER_DEFINE_SOCDATA_FUNC(uniphier_get_initdata, uniphier_initdata)
117 const struct uniphier_initdata *initdata;
121 initdata = uniphier_get_initdata();
123 pr_err("unsupported SoC\n");
127 initdata->sbc_init();
133 if (initdata->pll_init)
134 initdata->pll_init();
138 if (initdata->clk_init)
139 initdata->clk_init();
143 if (initdata->misc_init)
144 initdata->misc_init();
148 support_card_late_init();