150472Speter/*
237Srgrimes * Copyright 2017, Data61
337Srgrimes * Commonwealth Scientific and Industrial Research Organisation (CSIRO)
437Srgrimes * ABN 41 687 119 230.
537Srgrimes *
637Srgrimes * This software may be distributed and modified according to the terms of
737Srgrimes * the BSD 2-Clause license. Note that NO WARRANTY is provided.
837Srgrimes * See "LICENSE_BSD2.txt" for details.
937Srgrimes *
1037Srgrimes * @TAG(DATA61_BSD)
1137Srgrimes */
1237Srgrimes
1337Srgrimes#pragma once
1437Srgrimes
1537Srgrimes#include <platsupport/io.h>
1637Srgrimes
1737Srgrimes#define EXYNOS5_POWER_PADDR    0x10040000
18#define EXYNOS5_POWER_SIZE     0x5000
19#define EXYNOS5_SYSREG_PADDR   0x10050000
20#define EXYNOS5_SYSREG_SIZE    0x1000
21
22struct sysreg {
23    void* sysreg_vaddr[1];
24    void* pwrreg_vaddr[5];
25};
26typedef struct sysreg sysreg_t;
27
28/**
29 * Initialise the system register subsystem
30 * @param[in]  ops     a structure containing OS specific operations for memory access
31 * @param[out] sysreg  A sysreg structure to initialise
32 * @return             0 on success
33 */
34int exynos5_sysreg_init(ps_io_ops_t* ops, sysreg_t* sysreg);
35
36enum usb_phy_id {
37    USBPHY_USB2,
38    USBPHY_NUSBPHY
39};
40
41/**
42 * Enable power for USB PHYs
43 * @param[in] phy_id  The ID of the phy to power up
44 * @param[in] sysreg  A handle to the sysreg subsystem
45 * @return            0 on success
46 */
47int exynos5_sysreg_usbphy_enable(enum usb_phy_id phy_id, sysreg_t* sysreg);
48
49