Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x1s: Bringup VQMMC via speedy #23

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 52 additions & 3 deletions board/samsung/board-x1s.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#include <board.h>
#include <drivers/framework.h>
#include <lib/simplefb.h>

#define DECON_F_BASE 0x19050000
#define HW_SW_TRIG_CONTROL 0x70
#include <lib/debug.h>
#include <soc/exynos990.h>
#include <drivers/samsung/exynos-speedy.h>

void init_board_funcs(void *board)
{
Expand All @@ -24,6 +24,53 @@ void init_board_funcs(void *board)
board_restruct->name = "X1S";
}

struct s2mps19_data {
uint32_t ldo_address;
};

static void s2mps19_setup(void)
{
int ret;
struct speedy_transaction s2mps19;

/* S2MPS19 configuration */
s2mps19.base = SPEEDY_0_BASE;
s2mps19.slave = S2MPS19_PM_ADDR;

/*
* Define LDO control register values
* Values have been borrowed from Linaro's LK
*/
const struct s2mps19_data data[] = {
{
S2MPS19_PM_LDO2M_CTRL
}, {
S2MPS19_PM_LDO15M_CTRL
}
};

/* Configure LDOs */
for (int i = 0; i < 3; i++) {
s2mps19.offset = data[i].ldo_address;

ret = speedy_read(&s2mps19);
if (ret)
goto handle_err;

s2mps19.val |= S2MPS_OUTPUT_ON_NORMAL;

ret = speedy_write(&s2mps19);
if (ret)
goto handle_err;
}

return;

handle_err:
printk(KERN_ERR, "s2mps19: err\n");
return;
}

// Early initialization
int board_init(void)
{
Expand All @@ -35,6 +82,8 @@ int board_init(void)
// Late initialization
int board_late_init(void)
{
s2mps19_setup();

return 0;
}

Expand Down
14 changes: 14 additions & 0 deletions include/soc/exynos990.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,18 @@
#define DECON_F_BASE 0x19050000
#define HW_SW_TRIG_CONTROL 0x70

#define SPEEDY_0_BASE 0x15940000

/* All exynos990 devices use S2MPS_19_22 */

/* S2MPS19 slave address */
#define S2MPS19_PM_ADDR 0x1

/* S2MPS19 Register Address */
#define S2MPS19_PM_LDO2M_CTRL 0x047
#define S2MPS19_PM_LDO15M_CTRL 0x054

/* LDOx_CTRL */
#define S2MPS_OUTPUT_ON_NORMAL (0x3 << 6)

#endif // EXYNOS990_H_