1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2012-2015 Panasonic Corporation
4 * Copyright (C) 2015-2016 Socionext Inc.
5 * Author: Masahiro Yamada <yamada.masahiro@socionext.com>
8 #include <linux/errno.h>
10 #include <linux/printk.h>
13 #include "micro-support-card.h"
16 #ifdef CONFIG_ARCH_UNIPHIER_LD20
17 static void uniphier_ld20_misc_init(void)
19 /* ES1 errata: increase VDD09 supply to suppress VBO noise */
20 if (uniphier_get_soc_revision() == 1) {
21 writel(0x00000003, 0x6184e004);
22 writel(0x00000100, 0x6184e040);
23 writel(0x0000b500, 0x6184e024);
24 writel(0x00000001, 0x6184e000);
29 struct uniphier_initdata {
31 void (*sbc_init)(void);
32 void (*pll_init)(void);
33 void (*clk_init)(void);
34 void (*misc_init)(void);
37 static const struct uniphier_initdata uniphier_initdata[] = {
38 #if defined(CONFIG_ARCH_UNIPHIER_LD4)
40 .soc_id = UNIPHIER_LD4_ID,
41 .sbc_init = uniphier_ld4_sbc_init,
42 .pll_init = uniphier_ld4_pll_init,
43 .clk_init = uniphier_ld4_clk_init,
46 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
48 .soc_id = UNIPHIER_PRO4_ID,
49 .sbc_init = uniphier_sbc_init_savepin,
50 .pll_init = uniphier_pro4_pll_init,
51 .clk_init = uniphier_pro4_clk_init,
54 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
56 .soc_id = UNIPHIER_SLD8_ID,
57 .sbc_init = uniphier_ld4_sbc_init,
58 .pll_init = uniphier_ld4_pll_init,
59 .clk_init = uniphier_ld4_clk_init,
62 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
64 .soc_id = UNIPHIER_PRO5_ID,
65 .sbc_init = uniphier_sbc_init_savepin,
66 .clk_init = uniphier_pro5_clk_init,
69 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
71 .soc_id = UNIPHIER_PXS2_ID,
72 .sbc_init = uniphier_pxs2_sbc_init,
73 .clk_init = uniphier_pxs2_clk_init,
76 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
78 .soc_id = UNIPHIER_LD6B_ID,
79 .sbc_init = uniphier_pxs2_sbc_init,
80 .clk_init = uniphier_pxs2_clk_init,
83 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
85 .soc_id = UNIPHIER_LD11_ID,
86 .sbc_init = uniphier_ld11_sbc_init,
87 .pll_init = uniphier_ld11_pll_init,
88 .clk_init = uniphier_ld11_clk_init,
91 #if defined(CONFIG_ARCH_UNIPHIER_LD20)
93 .soc_id = UNIPHIER_LD20_ID,
94 .sbc_init = uniphier_ld11_sbc_init,
95 .pll_init = uniphier_ld20_pll_init,
96 .clk_init = uniphier_ld20_clk_init,
97 .misc_init = uniphier_ld20_misc_init,
100 #if defined(CONFIG_ARCH_UNIPHIER_PXS3)
102 .soc_id = UNIPHIER_PXS3_ID,
103 .sbc_init = uniphier_pxs2_sbc_init,
104 .pll_init = uniphier_pxs3_pll_init,
105 .clk_init = uniphier_pxs3_clk_init,
109 UNIPHIER_DEFINE_SOCDATA_FUNC(uniphier_get_initdata, uniphier_initdata)
113 const struct uniphier_initdata *initdata;
117 initdata = uniphier_get_initdata();
119 pr_err("unsupported SoC\n");
123 initdata->sbc_init();
129 if (initdata->pll_init)
130 initdata->pll_init();
134 if (initdata->clk_init)
135 initdata->clk_init();
139 if (initdata->misc_init)
140 initdata->misc_init();
144 support_card_late_init();