blob: 12d0d8fd34a673cbbccd9c0a7939b1c8a823914a [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001// SPDX-License-Identifier: GPL-2.0+
Donghwa Lee283591f2012-04-05 19:36:10 +00002/*
3 * Copyright (C) 2012 Samsung Electronics
4 * Donghwa Lee <dh09.lee@samsung.com>
Donghwa Lee283591f2012-04-05 19:36:10 +00005 */
6
7#include <common.h>
8#include <asm/io.h>
9#include <asm/arch/system.h>
10
Rajeshwari Shinde71045da2012-05-14 05:52:02 +000011static void exynos5_set_usbhost_mode(unsigned int mode)
12{
13 struct exynos5_sysreg *sysreg =
14 (struct exynos5_sysreg *)samsung_get_base_sysreg();
Rajeshwari Shinde71045da2012-05-14 05:52:02 +000015
16 /* Setting USB20PHY_CONFIG register to USB 2.0 HOST link */
17 if (mode == USB20_PHY_CFG_HOST_LINK_EN) {
18 setbits_le32(&sysreg->usb20phy_cfg,
19 USB20_PHY_CFG_HOST_LINK_EN);
20 } else {
21 clrbits_le32(&sysreg->usb20phy_cfg,
22 USB20_PHY_CFG_HOST_LINK_EN);
23 }
24}
25
26void set_usbhost_mode(unsigned int mode)
27{
28 if (cpu_is_exynos5())
29 exynos5_set_usbhost_mode(mode);
30}
31
Donghwa Lee283591f2012-04-05 19:36:10 +000032static void exynos4_set_system_display(void)
33{
34 struct exynos4_sysreg *sysreg =
35 (struct exynos4_sysreg *)samsung_get_base_sysreg();
36 unsigned int cfg = 0;
37
38 /*
39 * system register path set
40 * 0: MIE/MDNIE
41 * 1: FIMD Bypass
42 */
43 cfg = readl(&sysreg->display_ctrl);
44 cfg |= (1 << 1);
45 writel(cfg, &sysreg->display_ctrl);
46}
47
Donghwa Lee46524be2012-07-02 01:15:53 +000048static void exynos5_set_system_display(void)
49{
50 struct exynos5_sysreg *sysreg =
51 (struct exynos5_sysreg *)samsung_get_base_sysreg();
52 unsigned int cfg = 0;
53
54 /*
55 * system register path set
56 * 0: MIE/MDNIE
57 * 1: FIMD Bypass
58 */
59 cfg = readl(&sysreg->disp1blk_cfg);
60 cfg |= (1 << 15);
61 writel(cfg, &sysreg->disp1blk_cfg);
62}
63
Donghwa Lee283591f2012-04-05 19:36:10 +000064void set_system_display_ctrl(void)
65{
66 if (cpu_is_exynos4())
67 exynos4_set_system_display();
Donghwa Lee46524be2012-07-02 01:15:53 +000068 else
69 exynos5_set_system_display();
Donghwa Lee283591f2012-04-05 19:36:10 +000070}