blob: ad12445832cf7415e52e8593b595ab33a0b4d375 [file] [log] [blame]
Donghwa Lee283591f2012-04-05 19:36:10 +00001/*
2 * Copyright (C) 2012 Samsung Electronics
3 * Donghwa Lee <dh09.lee@samsung.com>
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
Donghwa Lee283591f2012-04-05 19:36:10 +00006 */
7
8#include <common.h>
9#include <asm/io.h>
10#include <asm/arch/system.h>
11
Rajeshwari Shinde71045da2012-05-14 05:52:02 +000012static void exynos5_set_usbhost_mode(unsigned int mode)
13{
14 struct exynos5_sysreg *sysreg =
15 (struct exynos5_sysreg *)samsung_get_base_sysreg();
Rajeshwari Shinde71045da2012-05-14 05:52:02 +000016
17 /* Setting USB20PHY_CONFIG register to USB 2.0 HOST link */
18 if (mode == USB20_PHY_CFG_HOST_LINK_EN) {
19 setbits_le32(&sysreg->usb20phy_cfg,
20 USB20_PHY_CFG_HOST_LINK_EN);
21 } else {
22 clrbits_le32(&sysreg->usb20phy_cfg,
23 USB20_PHY_CFG_HOST_LINK_EN);
24 }
25}
26
27void set_usbhost_mode(unsigned int mode)
28{
29 if (cpu_is_exynos5())
30 exynos5_set_usbhost_mode(mode);
31}
32
Donghwa Lee283591f2012-04-05 19:36:10 +000033static void exynos4_set_system_display(void)
34{
35 struct exynos4_sysreg *sysreg =
36 (struct exynos4_sysreg *)samsung_get_base_sysreg();
37 unsigned int cfg = 0;
38
39 /*
40 * system register path set
41 * 0: MIE/MDNIE
42 * 1: FIMD Bypass
43 */
44 cfg = readl(&sysreg->display_ctrl);
45 cfg |= (1 << 1);
46 writel(cfg, &sysreg->display_ctrl);
47}
48
Donghwa Lee46524be2012-07-02 01:15:53 +000049static void exynos5_set_system_display(void)
50{
51 struct exynos5_sysreg *sysreg =
52 (struct exynos5_sysreg *)samsung_get_base_sysreg();
53 unsigned int cfg = 0;
54
55 /*
56 * system register path set
57 * 0: MIE/MDNIE
58 * 1: FIMD Bypass
59 */
60 cfg = readl(&sysreg->disp1blk_cfg);
61 cfg |= (1 << 15);
62 writel(cfg, &sysreg->disp1blk_cfg);
63}
64
Donghwa Lee283591f2012-04-05 19:36:10 +000065void set_system_display_ctrl(void)
66{
67 if (cpu_is_exynos4())
68 exynos4_set_system_display();
Donghwa Lee46524be2012-07-02 01:15:53 +000069 else
70 exynos5_set_system_display();
Donghwa Lee283591f2012-04-05 19:36:10 +000071}