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+
9 #include <linux/errno.h>
11 #include <linux/printk.h>
14 #include "micro-support-card.h"
17 #ifdef CONFIG_ARCH_UNIPHIER_LD20
18 static void uniphier_ld20_misc_init(void)
20 /* ES1 errata: increase VDD09 supply to suppress VBO noise */
21 if (uniphier_get_soc_revision() == 1) {
22 writel(0x00000003, 0x6184e004);
23 writel(0x00000100, 0x6184e040);
24 writel(0x0000b500, 0x6184e024);
25 writel(0x00000001, 0x6184e000);
30 struct uniphier_initdata {
32 void (*sbc_init)(void);
33 void (*pll_init)(void);
34 void (*clk_init)(void);
35 void (*misc_init)(void);
38 static const struct uniphier_initdata uniphier_initdata[] = {
39 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
41 .soc_id = UNIPHIER_LD4_ID,
42 .sbc_init = uniphier_ld4_sbc_init,
43 .pll_init = uniphier_ld4_pll_init,
44 .clk_init = uniphier_ld4_clk_init,
47 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
49 .soc_id = UNIPHIER_PRO4_ID,
50 .sbc_init = uniphier_sbc_init_savepin,
51 .pll_init = uniphier_pro4_pll_init,
52 .clk_init = uniphier_pro4_clk_init,
55 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
57 .soc_id = UNIPHIER_SLD8_ID,
58 .sbc_init = uniphier_ld4_sbc_init,
59 .pll_init = uniphier_ld4_pll_init,
60 .clk_init = uniphier_ld4_clk_init,
63 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
65 .soc_id = UNIPHIER_PRO5_ID,
66 .sbc_init = uniphier_sbc_init_savepin,
67 .clk_init = uniphier_pro5_clk_init,
70 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
72 .soc_id = UNIPHIER_PXS2_ID,
73 .sbc_init = uniphier_pxs2_sbc_init,
74 .clk_init = uniphier_pxs2_clk_init,
77 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
79 .soc_id = UNIPHIER_LD6B_ID,
80 .sbc_init = uniphier_pxs2_sbc_init,
81 .clk_init = uniphier_pxs2_clk_init,
84 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
86 .soc_id = UNIPHIER_LD11_ID,
87 .sbc_init = uniphier_ld11_sbc_init,
88 .pll_init = uniphier_ld11_pll_init,
89 .clk_init = uniphier_ld11_clk_init,
92 #if defined(CONFIG_ARCH_UNIPHIER_LD20)
94 .soc_id = UNIPHIER_LD20_ID,
95 .sbc_init = uniphier_ld11_sbc_init,
96 .pll_init = uniphier_ld20_pll_init,
97 .clk_init = uniphier_ld20_clk_init,
98 .misc_init = uniphier_ld20_misc_init,
101 #if defined(CONFIG_ARCH_UNIPHIER_PXS3)
103 .soc_id = UNIPHIER_PXS3_ID,
104 .sbc_init = uniphier_pxs2_sbc_init,
105 .pll_init = uniphier_pxs3_pll_init,
106 .clk_init = uniphier_pxs3_clk_init,
110 UNIPHIER_DEFINE_SOCDATA_FUNC(uniphier_get_initdata, uniphier_initdata)
114 const struct uniphier_initdata *initdata;
118 initdata = uniphier_get_initdata();
120 pr_err("unsupported SoC\n");
124 initdata->sbc_init();
130 if (initdata->pll_init)
131 initdata->pll_init();
135 if (initdata->clk_init)
136 initdata->clk_init();
140 if (initdata->misc_init)
141 initdata->misc_init();
145 support_card_late_init();