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,
45 #if defined(CONFIG_ARCH_UNIPHIER_PRO4)
47 .soc_id = UNIPHIER_PRO4_ID,
48 .sbc_init = uniphier_sbc_init_savepin,
49 .pll_init = uniphier_pro4_pll_init,
50 .clk_init = uniphier_pro4_clk_init,
53 #if defined(CONFIG_ARCH_UNIPHIER_SLD8)
55 .soc_id = UNIPHIER_SLD8_ID,
56 .sbc_init = uniphier_ld4_sbc_init,
57 .pll_init = uniphier_ld4_pll_init,
60 #if defined(CONFIG_ARCH_UNIPHIER_PRO5)
62 .soc_id = UNIPHIER_PRO5_ID,
63 .sbc_init = uniphier_sbc_init_savepin,
64 .clk_init = uniphier_pro5_clk_init,
67 #if defined(CONFIG_ARCH_UNIPHIER_PXS2)
69 .soc_id = UNIPHIER_PXS2_ID,
70 .sbc_init = uniphier_pxs2_sbc_init,
71 .clk_init = uniphier_pxs2_clk_init,
74 #if defined(CONFIG_ARCH_UNIPHIER_LD6B)
76 .soc_id = UNIPHIER_LD6B_ID,
77 .sbc_init = uniphier_pxs2_sbc_init,
78 .clk_init = uniphier_pxs2_clk_init,
81 #if defined(CONFIG_ARCH_UNIPHIER_LD11)
83 .soc_id = UNIPHIER_LD11_ID,
84 .sbc_init = uniphier_ld11_sbc_init,
85 .pll_init = uniphier_ld11_pll_init,
86 .clk_init = uniphier_ld11_clk_init,
89 #if defined(CONFIG_ARCH_UNIPHIER_LD20)
91 .soc_id = UNIPHIER_LD20_ID,
92 .sbc_init = uniphier_ld11_sbc_init,
93 .pll_init = uniphier_ld20_pll_init,
94 .clk_init = uniphier_ld20_clk_init,
95 .misc_init = uniphier_ld20_misc_init,
98 #if defined(CONFIG_ARCH_UNIPHIER_PXS3)
100 .soc_id = UNIPHIER_PXS3_ID,
101 .sbc_init = uniphier_pxs2_sbc_init,
102 .pll_init = uniphier_pxs3_pll_init,
103 .clk_init = uniphier_pxs3_clk_init,
107 UNIPHIER_DEFINE_SOCDATA_FUNC(uniphier_get_initdata, uniphier_initdata)
111 const struct uniphier_initdata *initdata;
115 initdata = uniphier_get_initdata();
117 pr_err("unsupported SoC\n");
121 initdata->sbc_init();
127 if (initdata->pll_init)
128 initdata->pll_init();
132 if (initdata->clk_init)
133 initdata->clk_init();
137 if (initdata->misc_init)
138 initdata->misc_init();
142 support_card_late_init();
146 uniphier_nand_reset_assert();